Skip to content

chore(ci): update actions/cache to v2 #5580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build

on:
push:
branches:
- dev
- master
pull_request:
branches:
- dev
- master

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [10, 12]

steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Set Node.js version
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache node_modules
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ matrix.os }}-node-v${{ matrix.node }}-yarn-
${{ matrix.os }}-node-v${{ matrix.node }}-
${{ matrix.os }}-

- name: Install dependencies
run: yarn install --check-files --frozen-lockfile --non-interactive

- name: Build
run: yarn run build

- name: BundleWatch
run: yarn run bundlewatch
if: matrix.node == '12'
env:
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_TOKEN }}"
155 changes: 38 additions & 117 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ on:
- master

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

strategy:
matrix:
os: [ubuntu-latest]
node: [10, 12]
node: [12]

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

- name: Cache node_modules
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-v${{ matrix.node }}-${{ hashFiles('yarn.lock') }}
${{ runner.OS }}-node-v${{ matrix.node }}-
${{ runner.OS }}-
${{ matrix.os }}-node-v${{ matrix.node }}-yarn-
${{ matrix.os }}-node-v${{ matrix.node }}-
${{ matrix.os }}-

- name: Install dependencies
run: yarn install --check-files --frozen-lockfile --non-interactive

- name: Cache workspace
uses: actions/cache@v1
with:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }}

lint:
needs: setup
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [12]

steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Set Node.js version
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Restore workspace cache
uses: actions/cache@v1
with:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }}

- name: Lint
run: yarn run test:lint

audit:
needs: setup
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -97,17 +65,27 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Restore workspace cache
uses: actions/cache@v1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache node_modules
uses: actions/cache@v2
with:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ matrix.os }}-node-v${{ matrix.node }}-yarn-
${{ matrix.os }}-node-v${{ matrix.node }}-
${{ matrix.os }}-

- name: Install dependencies
run: yarn install --check-files --frozen-lockfile --non-interactive

- name: Audit
run: yarn run audit

test-unit:
needs: setup
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -124,86 +102,29 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Restore workspace cache
uses: actions/cache@v1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache node_modules
uses: actions/cache@v2
with:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ matrix.os }}-node-v${{ matrix.node }}-yarn-
${{ matrix.os }}-node-v${{ matrix.node }}-
${{ matrix.os }}-

- name: Install dependencies
run: yarn install --check-files --frozen-lockfile --non-interactive

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

- name: CodeCov
uses: codecov/codecov-action@v1
if: matrix.node == '10'
if: matrix.node == '12'
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unittests

build:
needs: setup
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [12]

steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Set Node.js version
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Restore workspace cache
uses: actions/cache@v1
with:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }}

- name: Build
run: yarn run build

- name: Upload build files
uses: actions/upload-artifact@v1
with:
name: build-files
path: dist

bundlewatch:
needs: build
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node: [12]

steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Set Node.js version
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Restore workspace cache
uses: actions/cache@v1
with:
path: ${{ github.workspace }}
key: ${{ matrix.os }}-node-v${{ matrix.node }}-bootstrap-vue-${{ github.sha }}

- name: Download build files
uses: actions/download-artifact@v1
with:
name: build-files
path: dist

- name: BundleWatch
run: yarn run bundlewatch
env:
BUNDLEWATCH_GITHUB_TOKEN: "${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}"