-
Notifications
You must be signed in to change notification settings - Fork 5
59 lines (58 loc) · 1.96 KB
/
main.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
name: Install, Build & Run Cypress
on: [push]
env:
NODE_ENV: test
ACTIONS_ALLOW_UNSECURE_COMMANDS: ${{ secrets.ACTIONS_ALLOW_UNSECURE_COMMANDS }}
CYPRESS_DASHBOARD_KEY: ${{ secrets.CYPRESS_DASHBOARD_KEY }}
CYPRESS_TEST_USERNAME: ${{ secrets.CYPRESS_TEST_USERNAME }}
CYPRESS_TEST_PASSWORD: ${{ secrets.CYPRESS_TEST_PASSWORD }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Extract Branch Name
run: echo "::set-env name=BRANCH::${GITHUB_REF##*/}"
- uses: actions/checkout@v3
with:
ref: ${{ env.BRANCH }}
- uses: actions/setup-node@v3
with:
node-version: lts/*
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# - name: Cache Cypress
# uses: actions/cache@v1
# id: cypress_cache
# with:
# path: ~/.cache/Cypress
# key: ${{ runner.os }}-cypress-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-cypress-
- name: Install Packages
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn;
- name: Run Tests
run: yarn run test:unit;
# - name: Save Test Data
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: Cypress Videos
# path: ./cypress/videos/
- name: Create Badge For Coverage Results
run: yarn create-coverage-badge;
- name: Commit Coverage Results
uses: EndBug/add-and-commit@v9
with:
add: 'coverage/shields.json'
committer_name: GitHub Action
committer_email: [email protected]
message: 'Add Coverage Results'