-
Notifications
You must be signed in to change notification settings - Fork 49
77 lines (59 loc) · 1.86 KB
/
nightly.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
name: Nightly
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # at 12:00:00pm every day
jobs:
check-latest-commit-date:
name: Check the latest commit
runs-on: ubuntu-latest
outputs:
should-run: ${{ steps.should-run.outputs.should-run }}
steps:
- uses: actions/checkout@v4
- name: Check the latest commit
id: should-run
continue-on-error: true
if: ${{ github.event_name == 'schedule' }}
run: |
[[ $(git rev-list --after="24 hours" --first-parent HEAD) ]] && echo "::set-output name=should-run::true"
test:
name: Full test
runs-on: [self-hosted, CI]
timeout-minutes: 1200
needs: check-latest-commit-date
if: needs.check-latest-commit-date.outputs.should-run == 'true'
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
all_but_latest: true
access_token: ${{ github.token }}
- name: Check out the repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache dependencies
uses: actions/cache@v3
id: yarn-cache
with:
path: |
**/node_modules
${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Build
run: yarn build
- name: Test
run: yarn test:nightly