-
Notifications
You must be signed in to change notification settings - Fork 29
79 lines (66 loc) · 1.89 KB
/
pr-checks.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
78
79
name: PR Checks
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
workflow_dispatch:
env:
NODE_VER: 18.x
jobs:
test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
- name: Install & display rust toolchain
run: |
rustup show
rustup component add rust-src
- name: Check targets are installed correctly
run: rustup target list --installed
- name: Cache Crates
uses: actions/cache@v3
with:
path: ~/.cargo
key: ${{ runner.os }}-rust-${{ hashFiles('rust-toolchain.toml') }}
restore-keys: |
${{ runner.os }}-rust
- name: Check if cargo-contract exists
id: check-cargo-contract
continue-on-error: true
run: cargo contract --version
- name: Install cargo contract
if: ${{ steps.check-cargo-contract.outcome == 'failure' }}
run: |
cargo install cargo-dylint dylint-link
cargo install --force --locked cargo-contract
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VER }}
- name: yarn test
run: yarn && yarn test
lint-check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VER }}
- name: yarn lint
run: yarn && yarn lint
build-check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: Checkout the source code
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VER }}
- name: yarn build
run: yarn && yarn build