Skip to content

Commit 5601eb7

Browse files
Add minimal build/test workflow
Copied from vscode-trace-extension and adapted to run the existing tests in this repo. Signed-off-by: Marc Dumais <[email protected]>
1 parent 4ebbb2d commit 5601eb7

File tree

2 files changed

+77
-1
lines changed

2 files changed

+77
-1
lines changed

.github/workflows/build.yml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
11+
build:
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
os: [ubuntu-latest]
17+
node-version: [16.x]
18+
19+
steps:
20+
- name: install dependencies on ubuntu
21+
if: startsWith(matrix.os,'ubuntu')
22+
run: |
23+
sudo apt install -y make gcc pkg-config build-essential libx11-dev libxkbfile-dev
24+
25+
- uses: actions/checkout@v2
26+
27+
- name: Use Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v1
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
32+
- name: Get yarn cache directory path
33+
id: yarn-cache-dir-path
34+
run: echo "::set-output name=dir::$(yarn cache dir)"
35+
36+
- name: Cache node_modules with yarn
37+
uses: actions/cache@v2
38+
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
39+
with:
40+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
41+
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
42+
restore-keys: |
43+
${{ runner.os }}-yarn-
44+
45+
- run: yarn --frozen-lockfile
46+
47+
tests:
48+
timeout-minutes: 60
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v3
52+
- uses: actions/setup-node@v3
53+
with:
54+
node-version: 16
55+
- name: Install dependencies
56+
run: yarn
57+
- name: Run tests
58+
uses: coactions/setup-xvfb@v1
59+
with:
60+
run: yarn test
61+
62+
code-lint:
63+
runs-on: ubuntu-latest
64+
65+
steps:
66+
- name: Check out Git repository
67+
uses: actions/checkout@v2
68+
69+
- uses: actions/setup-node@v1
70+
with:
71+
node-version: '16'
72+
73+
# ESLint and Prettier must be in `package.json`
74+
- run: yarn --frozen-lockfile --ignore-scripts
75+
76+
- run: yarn lint

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This README is the usual entry point for documenting this extension.
2020
Run `yarn`, which should automatically include `yarn install`.
2121

2222
* This extension is bundled using `webpack`, originally based on [the guide][guide].
23-
* There is no support yet for any automated CI on GitHub; planned for though.
23+
* There is only a modest automated CI test suite being run on GitHub
2424

2525
## Test
2626

0 commit comments

Comments
 (0)