Skip to content

Commit 700a4be

Browse files
author
alexperez
committed
fix: update GitHub Actions workflow to support multiple OS and streamline dependency installation
1 parent 16be083 commit 700a4be

File tree

1 file changed

+14
-30
lines changed

1 file changed

+14
-30
lines changed

.github/workflows/deployment.yml

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,26 @@ on:
77
- master
88
- main
99
- develop
10+
- stage
11+
- support/*
1012
pull_request:
1113
branches:
12-
- master
1314
- main
15+
- develop
16+
1417
jobs:
15-
test_linux:
18+
tests:
1619
name: ${{ matrix.os }}
1720
strategy:
1821
fail-fast: false
1922
matrix:
20-
os: [ubuntu-20.04]
23+
os: [ubuntu-20.04, windows-2019]
2124
runs-on: ${{ matrix.os }}
2225
steps:
2326
- uses: actions/checkout@v2
2427
- uses: actions/setup-node@v1
2528
with:
26-
node-version: 16
27-
- uses: microsoft/playwright-github-action@v1
28-
- uses: actions/cache@v1
29-
with:
30-
path: ~/.npm
31-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
32-
restore-keys: |
33-
${{ runner.os }}-node-
34-
- name: Install dependencies
35-
run: npm ci
36-
- name: Run tests
37-
run: npm test
38-
test_win:
39-
name: "Windows"
40-
runs-on: windows-latest
41-
steps:
42-
- uses: actions/checkout@v2
43-
- uses: actions/setup-node@v1
44-
with:
45-
node-version: 16
29+
node-version: 18
4630
- uses: microsoft/playwright-github-action@v1
4731
- uses: actions/cache@v1
4832
with:
@@ -54,29 +38,29 @@ jobs:
5438
run: npm ci
5539
- name: Run tests
5640
run: npm test
41+
5742
tag:
5843
name: "Publishing release"
59-
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
44+
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
6045
needs:
61-
- test_linux
62-
- test_win
63-
runs-on: ubuntu-latest
46+
- tests
47+
runs-on: self-hosted
6448
steps:
6549
- name: Checkout code
6650
uses: actions/checkout@v2
6751
with:
6852
fetch-depth: 0
6953
- uses: actions/setup-node@v2
7054
with:
71-
node-version: '16.x'
55+
node-version: '18.x'
7256
registry-url: 'https://registry.npmjs.org'
73-
- uses: actions/cache@v2
57+
- uses: actions/cache@v1
7458
with:
7559
path: ~/.npm
7660
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
7761
restore-keys: |
7862
${{ runner.os }}-node-
79-
- run: npm install
63+
- run: npm ci
8064
- name: Read version from package.json
8165
uses: culshaw/read-package-node-version-actions@v1
8266
id: package-node-version

0 commit comments

Comments
 (0)