Skip to content

Commit 75b1868

Browse files
Jakob Jungreuthmayerjakobjung10
Jakob Jungreuthmayer
authored andcommitted
CI/CD
+ workflow for continuous integration + workflow for continuous deployment (vsce + ovsx) + bundling extension (esbuild) + added dev-dependencies and scripts (test, esbuild, deploy...) for CI/CD + added test-environment
1 parent a8065db commit 75b1868

13 files changed

+9344
-1524
lines changed

.github/workflows/cd.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CD
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- '**'
9+
10+
jobs:
11+
12+
# continuous integration
13+
CI:
14+
uses: ./.github/workflows/ci.yml
15+
16+
# continuous deployment
17+
CD:
18+
needs: CI
19+
strategy:
20+
matrix:
21+
os: ["ubuntu-22.04"]
22+
runs-on: ${{ matrix.os }}
23+
steps:
24+
25+
# checkout git repository
26+
- name: Checkout
27+
uses: actions/checkout@v3
28+
with:
29+
submodules: 'true'
30+
31+
# node
32+
- name: Install Node.js
33+
uses: actions/setup-node@v3
34+
with:
35+
node-version: 18.x
36+
- run: npm install
37+
38+
# publish to Visual Studio Code marketplace
39+
- name: Publish
40+
if: success() && startsWith(github.ref, 'refs/tags/v')
41+
run: npm run deploy
42+
env:
43+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
44+
OVSX_PAT: ${{ secrets.OVSX_PAT }}

.github/workflows/ci.yml

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: CI
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
pull_request:
7+
8+
jobs:
9+
10+
# ------------------------------------------------------------
11+
# build
12+
# ------------------------------------------------------------
13+
build:
14+
strategy:
15+
matrix:
16+
os: ["ubuntu-22.04"]
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
20+
# checkout git repository
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
with:
24+
submodules: 'true'
25+
26+
# node
27+
- name: Install Node.js
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: 18.x
31+
- run: npm install
32+
33+
# compile
34+
- run: npm run compile
35+
36+
# ------------------------------------------------------------
37+
# test
38+
# ------------------------------------------------------------
39+
test:
40+
needs: build
41+
strategy:
42+
matrix:
43+
os: ["ubuntu-22.04"]
44+
runs-on: ${{ matrix.os }}
45+
steps:
46+
47+
# checkout git repository
48+
- name: Checkout
49+
uses: actions/checkout@v3
50+
with:
51+
submodules: 'true'
52+
53+
# node
54+
- name: Install Node.js
55+
uses: actions/setup-node@v3
56+
with:
57+
node-version: 18.x
58+
- run: npm install
59+
60+
# ----------------------------------
61+
# download dependencies for testing
62+
# ----------------------------------
63+
64+
# python
65+
- name: Python
66+
uses: actions/setup-python@v5
67+
with:
68+
python-version: '3.10'
69+
- name: Install Python packages
70+
# VUnit
71+
run: |
72+
python -m pip install --upgrade pip
73+
pip install vunit_hdl
74+
75+
# GHDL
76+
- name: Install GHDL Ubuntu
77+
if: startsWith(matrix.os, 'ubuntu')
78+
env:
79+
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
80+
run: |
81+
mkdir ghdl
82+
cd ghdl
83+
wget https://github.com/ghdl/ghdl/releases/download/v0.37/ghdl-0.37-ubuntu16-mcode.tgz
84+
tar -xvzf ghdl-0.37-ubuntu16-mcode.tgz
85+
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gnat-4.9/gnat-4.9-base_4.9.3-3ubuntu5_amd64.deb
86+
sudo dpkg --install gnat-4.9-base_4.9.3-3ubuntu5_amd64.deb
87+
wget http://archive.ubuntu.com/ubuntu/pool/universe/g/gnat-4.9/libgnat-4.9_4.9.3-3ubuntu5_amd64.deb
88+
sudo dpkg --install libgnat-4.9_4.9.3-3ubuntu5_amd64.deb
89+
echo "::set-env name=VUNIT_GHDL_PATH::$(pwd)/bin"
90+
cd ..
91+
- name: Install GHDL Windows
92+
if: startsWith(matrix.os, 'windows')
93+
env:
94+
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
95+
run: |
96+
mkdir ghdl
97+
cd ghdl
98+
Invoke-WebRequest https://github.com/ghdl/ghdl/releases/download/v0.37/ghdl-0.37-mingw32-mcode.zip -OutFile ghdl.zip
99+
Expand-Archive .\ghdl.zip .;
100+
echo "::set-env name=VUNIT_GHDL_PATH::$(pwd)/GHDL/0.37-mingw32-mcode/bin"
101+
cd ..
102+
- run: echo $VUNIT_GHDL_PATH
103+
104+
# --------
105+
# testing
106+
# --------
107+
- name: Test
108+
uses: coactions/setup-xvfb@v1
109+
with:
110+
run: npm run test

.github/workflows/main.yml

-61
This file was deleted.

.vscode/launch.json

+15-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"version": "0.2.0",
77
"configurations": [
88
{
9-
"name": "Run Extension",
9+
"name": "Run Extension(tsc)",
1010
"type": "extensionHost",
1111
"request": "launch",
1212
"runtimeExecutable": "${execPath}",
@@ -16,7 +16,20 @@
1616
"outFiles": [
1717
"${workspaceFolder}/out/**/*.js"
1818
],
19-
"preLaunchTask": "${defaultBuildTask}"
19+
"preLaunchTask": "npm: watch"
20+
},
21+
{
22+
"name": "Run Extension(esbuild)",
23+
"type": "extensionHost",
24+
"request": "launch",
25+
"sourceMaps": true,
26+
"args": [
27+
"--extensionDevelopmentPath=${workspaceFolder}"
28+
],
29+
"outFiles": [
30+
"${workspaceFolder}/out/**/*.js"
31+
],
32+
"preLaunchTask": "npm: esbuild"
2033
},
2134
{
2235
"name": "Extension Tests",

.vscodeignore

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
**/*.map
2-
.vscode
3-
package-lock.json
4-
tsconfig.json
1+
node_modules
52
.vscode/**
6-
.gitignore
7-
*.vsix
3+
.vscode-test/**
84
out/test/**
9-
src/test/**
5+
src/**
6+
vsc-extension-quickstart.md
7+
**/tsconfig.json
8+
**/.eslintrc.json
9+
**/.eslintignore
10+
**/*.map
11+
**/*.ts
12+
.gitignore
13+
.gitmodules
14+
.github
15+
package-lock.json
16+
*.vsix

0 commit comments

Comments
 (0)