forked from bancorprotocol/carbon-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (54 loc) · 1.55 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
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@v3
- 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 "should-run=true" >> $GITHUB_OUTPUT
test:
name: Full test
runs-on: ubuntu-latest
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@v3
with:
submodules: recursive
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'pnpm'
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
- name: Install dependencies
run: pnpm install
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test