forked from simonsmith/cypress-image-snapshot
-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (52 loc) · 1.39 KB
/
build-and-test.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
name: build-and-test
on: [push, pull_request]
jobs:
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: './.github/actions/install'
lint:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: yarn install
uses: ./.github/actions/yarn-nm-install
- name: Run lint
if: ${{ github.ref == 'refs/heads/master' }}
run: yarn lint
cypress:
needs: [install, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: yarn install
uses: ./.github/actions/yarn-nm-install
- name: Restore Cypress binary
run: yarn install
- name: Run tests
run: yarn test:run
release:
needs: [cypress, lint]
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v3
- name: yarn install
uses: ./.github/actions/yarn-nm-install
- name: Release
if: ${{ github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# ci:build outputs all the files to the root so that users do not
# need to install from `dist`
yarn ci:build
yarn release