-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (51 loc) · 1.38 KB
/
tests.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
---
on:
push:
branches:
- master
- develop
pull_request:
name: Tests
jobs:
test:
name: Test suite (mainnet)
runs-on: ubuntu-latest
steps:
- name: Clone the repository
uses: actions/checkout@v4
- name: Install cargo-make
run: cargo make -V || cargo install cargo-make
- name: Install sandbox
run: |
if [[ ! -f ${{ env.NEAR_SANDBOX_BIN_PATH }} ]]; then
rm -rf nearcore
git clone --depth 1 --branch 1.35.0 https://github.com/near/nearcore
cd nearcore
make sandbox-release
cp target/release/near-sandbox ${{ env.NEAR_SANDBOX_BIN_PATH }}
cd ../
rm -rf nearcore
fi
- name: Test mainnet
run: cargo make --profile mainnet test
test-build:
name: Build and diff
runs-on: ubuntu-latest
steps:
- name: Clone the repository
uses: actions/checkout@v4
- name: Build
run: ./build.sh
- name: Diff
run: |
git diff
git status
changed_files=$(git status --porcelain --untracked-files=no | wc -l)
if [ $changed_files -gt 0 ]; then
echo 'contract changed, please rebuild contract'
exit 1
fi
env:
NEAR_SANDBOX_BIN_PATH: /usr/local/bin/near-sandbox
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0