Skip to content

Commit 9d3b101

Browse files
authored
Merge pull request #66 from badsyntax/matrix-os
Update to use OS matrix
2 parents fdf8423 + 44ce618 commit 9d3b101

File tree

1 file changed

+14
-65
lines changed

1 file changed

+14
-65
lines changed

.github/workflows/nodejs.yml

Lines changed: 14 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ jobs:
2828
name: lib
2929
path: lib
3030

31-
build-test-linux:
31+
build-test:
3232
needs: [artifacts]
33-
runs-on: ubuntu-18.04
33+
runs-on: ${{ matrix.os }}
3434

3535
strategy:
3636
matrix:
3737
node-version: [12.x]
3838
java-version: ['8', '12.0.2']
39+
os: [ubuntu-latest, windows-latest, macOS-latest]
3940

4041
steps:
4142
- uses: actions/checkout@v1
@@ -52,80 +53,28 @@ jobs:
5253
with:
5354
java-version: ${{ matrix.java-version }}
5455
architecture: x64
55-
- name: Build & test extension
56+
- name: Set xvfb
5657
run: |
57-
chmod +x lib/gradle-tasks
58-
export DISPLAY=':99.0'
5958
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
60-
npm ci
61-
npm run lint
62-
npm test
63-
64-
build-test-macos:
65-
needs: [artifacts]
66-
runs-on: macos-latest
67-
68-
strategy:
69-
matrix:
70-
node-version: [12.x]
71-
java-version: ['8', '12.0.2']
72-
73-
steps:
74-
- uses: actions/checkout@v1
75-
- name: Download lib
76-
uses: actions/download-artifact@v1
77-
with:
78-
name: lib
79-
- name: Use Node.js ${{ matrix.node-version }}
80-
uses: actions/setup-node@v1
81-
with:
82-
node-version: ${{ matrix.node-version }}
83-
- name: Use Java ${{ matrix.java-version }}
84-
uses: actions/setup-java@v1
85-
with:
86-
java-version: ${{ matrix.java-version }}
87-
architecture: x64
88-
- name: Build & test extension
59+
env:
60+
DISPLAY: ':99.0'
61+
if: matrix.os == 'ubuntu-latest'
62+
- name: Set perms
8963
run: |
9064
chmod +x lib/gradle-tasks
9165
unset npm_config_prefix
92-
npm ci
93-
npm run lint
94-
npm test
95-
96-
build-test-windows:
97-
needs: [artifacts]
98-
runs-on: windows-latest
99-
100-
strategy:
101-
matrix:
102-
node-version: [12.x]
103-
java-version: ['8', '12.0.2']
104-
105-
steps:
106-
- uses: actions/checkout@v1
107-
- name: Download lib
108-
uses: actions/download-artifact@v1
109-
with:
110-
name: lib
111-
- name: Use Node.js ${{ matrix.node-version }}
112-
uses: actions/setup-node@v1
113-
with:
114-
node-version: ${{ matrix.node-version }}
115-
- name: Use Java ${{ matrix.java-version }}
116-
uses: actions/setup-java@v1
117-
with:
118-
java-version: ${{ matrix.java-version }}
119-
architecture: x64
120-
- name: Build & test extension
66+
if: matrix.os != 'windows-latest'
67+
- name: Build & test extension on ${{ matrix.os }}
12168
run: |
12269
npm ci
12370
npm run lint
12471
npm test
125-
shell: pwsh
72+
env:
73+
DISPLAY: ':99.0'
74+
CI: 'true'
12675

12776
publish:
128-
needs: [build-test-linux, build-test-macos, build-test-windows]
77+
needs: [build-test]
12978
if: github.event_name == 'release' && github.event.action == 'published'
13079
runs-on: ubuntu-18.04
13180

0 commit comments

Comments
 (0)