Skip to content

Commit b50a18f

Browse files
authored
chore(ci): update actions/cache to v2 (#5580)
* chore(ci): update `actions/cache` to v2 * Update test.yml * Update test.yml * fix(b-form-tags): unit tests * Revert "fix(b-form-tags): unit tests" This reverts commit 20ebc04. * Split actions * Run BundleWatch during build * Update build.yml * Revert "Update build.yml" This reverts commit ed4ad3d. * Update build.yml
1 parent 1fabd68 commit b50a18f

File tree

2 files changed

+93
-117
lines changed

2 files changed

+93
-117
lines changed

.github/workflows/build.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- master
8+
pull_request:
9+
branches:
10+
- dev
11+
- master
12+
13+
jobs:
14+
build:
15+
runs-on: ${{ matrix.os }}
16+
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest]
20+
node: [10, 12]
21+
22+
steps:
23+
- name: Clone repository
24+
uses: actions/checkout@v2
25+
26+
- name: Set Node.js version
27+
uses: actions/setup-node@v1
28+
with:
29+
node-version: ${{ matrix.node }}
30+
31+
- name: Get yarn cache directory path
32+
id: yarn-cache-dir-path
33+
run: echo "::set-output name=dir::$(yarn cache dir)"
34+
35+
- name: Cache node_modules
36+
uses: actions/cache@v2
37+
with:
38+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
39+
key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
40+
restore-keys: |
41+
${{ matrix.os }}-node-v${{ matrix.node }}-yarn-
42+
${{ matrix.os }}-node-v${{ matrix.node }}-
43+
${{ matrix.os }}-
44+
45+
- name: Install dependencies
46+
run: yarn install --check-files --frozen-lockfile --non-interactive
47+
48+
- name: Build
49+
run: yarn run build
50+
51+
- name: BundleWatch
52+
run: yarn run bundlewatch
53+
if: matrix.node == '12'
54+
env:
55+
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_TOKEN }}"

.github/workflows/test.yml

Lines changed: 38 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ on:
1111
- master
1212

1313
jobs:
14-
setup:
14+
lint:
1515
runs-on: ${{ matrix.os }}
16-
if: github.event_name == 'push' || !(github.base_ref == 'master' && github.head_ref == 'dev')
1716

1817
strategy:
1918
matrix:
2019
os: [ubuntu-latest]
21-
node: [10, 12]
20+
node: [12]
2221

2322
steps:
2423
- name: Clone repository
@@ -34,53 +33,22 @@ jobs:
3433
run: echo "::set-output name=dir::$(yarn cache dir)"
3534

3635
- name: Cache node_modules
37-
uses: actions/cache@v1
36+
uses: actions/cache@v2
3837
with:
3938
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
40-
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
39+
key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
4140
restore-keys: |
42-
${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
43-
${{ runner.OS }}-node-v${{ matrix.node }}-
44-
${{ runner.OS }}-
41+
${{ matrix.os }}-node-v${{ matrix.node }}-yarn-
42+
${{ matrix.os }}-node-v${{ matrix.node }}-
43+
${{ matrix.os }}-
4544
4645
- name: Install dependencies
4746
run: yarn install --check-files --frozen-lockfile --non-interactive
4847

49-
- name: Cache workspace
50-
uses: actions/cache@v1
51-
with:
52-
path: ${{ github.workspace }}
53-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }}
54-
55-
lint:
56-
needs: setup
57-
runs-on: ${{ matrix.os }}
58-
59-
strategy:
60-
matrix:
61-
os: [ubuntu-latest]
62-
node: [12]
63-
64-
steps:
65-
- name: Clone repository
66-
uses: actions/checkout@v2
67-
68-
- name: Set Node.js version
69-
uses: actions/setup-node@v1
70-
with:
71-
node-version: ${{ matrix.node }}
72-
73-
- name: Restore workspace cache
74-
uses: actions/cache@v1
75-
with:
76-
path: ${{ github.workspace }}
77-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }}
78-
7948
- name: Lint
8049
run: yarn run test:lint
8150

8251
audit:
83-
needs: setup
8452
runs-on: ${{ matrix.os }}
8553

8654
strategy:
@@ -97,17 +65,27 @@ jobs:
9765
with:
9866
node-version: ${{ matrix.node }}
9967

100-
- name: Restore workspace cache
101-
uses: actions/cache@v1
68+
- name: Get yarn cache directory path
69+
id: yarn-cache-dir-path
70+
run: echo "::set-output name=dir::$(yarn cache dir)"
71+
72+
- name: Cache node_modules
73+
uses: actions/cache@v2
10274
with:
103-
path: ${{ github.workspace }}
104-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }}
75+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
76+
key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
77+
restore-keys: |
78+
${{ matrix.os }}-node-v${{ matrix.node }}-yarn-
79+
${{ matrix.os }}-node-v${{ matrix.node }}-
80+
${{ matrix.os }}-
81+
82+
- name: Install dependencies
83+
run: yarn install --check-files --frozen-lockfile --non-interactive
10584

10685
- name: Audit
10786
run: yarn run audit
10887

10988
test-unit:
110-
needs: setup
11189
runs-on: ${{ matrix.os }}
11290

11391
strategy:
@@ -124,86 +102,29 @@ jobs:
124102
with:
125103
node-version: ${{ matrix.node }}
126104

127-
- name: Restore workspace cache
128-
uses: actions/cache@v1
105+
- name: Get yarn cache directory path
106+
id: yarn-cache-dir-path
107+
run: echo "::set-output name=dir::$(yarn cache dir)"
108+
109+
- name: Cache node_modules
110+
uses: actions/cache@v2
129111
with:
130-
path: ${{ github.workspace }}
131-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }}
112+
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
113+
key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
114+
restore-keys: |
115+
${{ matrix.os }}-node-v${{ matrix.node }}-yarn-
116+
${{ matrix.os }}-node-v${{ matrix.node }}-
117+
${{ matrix.os }}-
118+
119+
- name: Install dependencies
120+
run: yarn install --check-files --frozen-lockfile --non-interactive
132121

133122
- name: Test unit
134123
run: yarn run test:unit --coverage --maxWorkers=2
135124

136125
- name: CodeCov
137126
uses: codecov/codecov-action@v1
138-
if: matrix.node == '10'
127+
if: matrix.node == '12'
139128
with:
140129
token: ${{ secrets.CODECOV_TOKEN }}
141130
flags: unittests
142-
143-
build:
144-
needs: setup
145-
runs-on: ${{ matrix.os }}
146-
147-
strategy:
148-
matrix:
149-
os: [ubuntu-latest]
150-
node: [12]
151-
152-
steps:
153-
- name: Clone repository
154-
uses: actions/checkout@v2
155-
156-
- name: Set Node.js version
157-
uses: actions/setup-node@v1
158-
with:
159-
node-version: ${{ matrix.node }}
160-
161-
- name: Restore workspace cache
162-
uses: actions/cache@v1
163-
with:
164-
path: ${{ github.workspace }}
165-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }}
166-
167-
- name: Build
168-
run: yarn run build
169-
170-
- name: Upload build files
171-
uses: actions/upload-artifact@v1
172-
with:
173-
name: build-files
174-
path: dist
175-
176-
bundlewatch:
177-
needs: build
178-
runs-on: ${{ matrix.os }}
179-
180-
strategy:
181-
matrix:
182-
os: [ubuntu-latest]
183-
node: [12]
184-
185-
steps:
186-
- name: Clone repository
187-
uses: actions/checkout@v2
188-
189-
- name: Set Node.js version
190-
uses: actions/setup-node@v1
191-
with:
192-
node-version: ${{ matrix.node }}
193-
194-
- name: Restore workspace cache
195-
uses: actions/cache@v1
196-
with:
197-
path: ${{ github.workspace }}
198-
key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }}
199-
200-
- name: Download build files
201-
uses: actions/download-artifact@v1
202-
with:
203-
name: build-files
204-
path: dist
205-
206-
- name: BundleWatch
207-
run: yarn run bundlewatch
208-
env:
209-
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}"

0 commit comments

Comments
 (0)