Skip to content

Commit 2efa956

Browse files
committed
build: automated tests ci
1 parent 3db67f4 commit 2efa956

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

.github/workflows/main.yml

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,32 @@
11
name: NPM Publish
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
6+
automated_tests:
7+
runs-on: ubuntu-latest
8+
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci') && github.ref !== main"
9+
steps:
10+
- uses: actions/checkout@v2
11+
12+
- name: Use Node.js 20.x
13+
uses: actions/setup-node@v1
14+
with:
15+
node-version: 20.x
16+
17+
- name: Cache node modules
18+
uses: actions/cache@v1
19+
with:
20+
path: node_modules
21+
key: yarn-deps-${{ hashFiles('yarn.lock') }}
22+
restore-keys: |
23+
yarn-deps-${{ hashFiles('yarn.lock') }}
24+
25+
- name: Run tests
26+
run: |
27+
yarn install --frozen-lockfile
28+
yarn test
29+
630
release:
731
runs-on: ubuntu-latest
832
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
@@ -17,6 +41,7 @@ jobs:
1741
- name: Prepare repository
1842
run: |
1943
git fetch --unshallow --tags
44+
2045
- name: Cache node modules
2146
uses: actions/cache@v1
2247
with:

0 commit comments

Comments
 (0)