Skip to content

Commit e4cef36

Browse files
committed
Refactor GitHub Actions workflow to improve testing setup by enabling Windows support, updating Node.js and checkout actions, and enhancing caching for npm dependencies.
1 parent 5b79e8c commit e4cef36

File tree

1 file changed

+41
-32
lines changed

1 file changed

+41
-32
lines changed

.github/workflows/deployment.yml

Lines changed: 41 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,64 +11,73 @@ on:
1111
branches:
1212
- master
1313
- main
14-
types: [opened, synchronize, reopened]
1514
jobs:
1615
test_linux:
1716
name: ${{ matrix.os }}
1817
strategy:
1918
fail-fast: false
2019
matrix:
2120
os: [ubuntu-22.04]
22-
# os: [ubuntu-20.04, ubuntu-22.04]
2321
runs-on: ${{ matrix.os }}
2422
steps:
25-
- uses: actions/checkout@v4
26-
- uses: actions/setup-node@v4
23+
- uses: actions/checkout@v2
24+
- uses: actions/setup-node@v1
2725
with:
2826
node-version: 18
29-
cache: 'npm'
27+
- uses: actions/cache@v3
28+
with:
29+
path: ~/.npm
30+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
31+
restore-keys: |
32+
${{ runner.os }}-node-
3033
- name: Install dependencies
31-
run: npm ci
34+
run: npm install
35+
- name: Install Playwright Browsers
36+
run: npx playwright install --with-deps
37+
- name: Run tests
38+
run: npm test
39+
test_win:
40+
name: "Windows"
41+
runs-on: windows-latest
42+
steps:
43+
- uses: actions/checkout@v2
44+
- uses: actions/setup-node@v1
45+
with:
46+
node-version: 18
47+
- uses: actions/cache@v3
48+
with:
49+
path: ~/.npm
50+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
51+
restore-keys: |
52+
${{ runner.os }}-node-
53+
- name: Install dependencies
54+
run: npm install
3255
- name: Install Playwright Browsers
3356
run: npx playwright install --with-deps
3457
- name: Run tests
3558
run: npm test
36-
# test_win:
37-
# name: "Windows"
38-
# runs-on: windows-latest
39-
# steps:
40-
# - uses: actions/checkout@v2
41-
# - uses: actions/setup-node@v1
42-
# with:
43-
# node-version: 14
44-
# - uses: microsoft/playwright-github-action@v1
45-
# - uses: actions/cache@v1
46-
# with:
47-
# path: ~/.npm
48-
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
49-
# restore-keys: |
50-
# ${{ runner.os }}-node-
51-
# - name: Install dependencies
52-
# run: npm ci
53-
# - name: Run tests
54-
# run: npm test
5559
tag:
5660
name: "Publishing release"
5761
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
58-
needs:
62+
needs:
5963
- test_linux
60-
# - test_win
61-
runs-on: ubuntu-22.04
64+
- test_win
65+
runs-on: ubuntu-latest
6266
steps:
6367
- name: Checkout code
64-
uses: actions/checkout@v4
68+
uses: actions/checkout@v2
6569
with:
6670
fetch-depth: 0
67-
- uses: actions/setup-node@v4
71+
- uses: actions/setup-node@v2
6872
with:
6973
node-version: '18.x'
7074
registry-url: 'https://registry.npmjs.org'
71-
cache: 'npm'
75+
- uses: actions/cache@v3
76+
with:
77+
path: ~/.npm
78+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
79+
restore-keys: |
80+
${{ runner.os }}-node-
7281
- run: npm install
7382
- name: Read version from package.json
7483
uses: culshaw/read-package-node-version-actions@v1
@@ -90,4 +99,4 @@ jobs:
9099
prerelease: false
91100
- run: npm publish --access public
92101
env:
93-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
102+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)