-
-
Notifications
You must be signed in to change notification settings - Fork 5
78 lines (75 loc) · 2.42 KB
/
test.release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Test Release
on: pull_request
jobs:
tests:
name: Test or Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 20
- id: vars
name: Find Yarn's cache folder
run: |
echo "::set-output name=path::$(yarn config get cacheFolder)"
echo "::set-output name=commithash::$(git rev-parse --short HEAD)"
- name: Cache node modules
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.vars.outputs.path }}
key: ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-
- name: Install dependencies
# if: ${{ !steps.yarn-cache.outputs.cache-hit }}
env:
CI: true
run: |
yarn install
yarn ci
- name: Build
run: yarn run build
- name: Test
env:
CI: true
run: yarn run test --coverage
test_publish:
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- id: vars
name: Find Yarn's cache folder
run: |
echo "::set-output name=path::$(yarn config get cacheFolder)"
echo "::set-output name=commithash::$(git rev-parse --short HEAD)"
- name: Cache node modules
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.vars.outputs.path }}
key: ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-
- name: Install dependencies
# if: ${{ !steps.yarn-cache.outputs.cache-hit }}
env:
CI: true
run: |
yarn install
yarn ci
- env:
CI: true
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
GITHUB_HEAD_REF: $GITHUB_HEAD_REF
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
run: |
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" > /home/runner/work/_temp/.npmrc
yarn run semantic-release --dry-run --debug -b $GITHUB_HEAD_REF