forked from foundry-rs/foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (64 loc) · 2.1 KB
/
integration-tests.yml
File metadata and controls
77 lines (64 loc) · 2.1 KB
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
on:
push:
branches:
- master
name: E2E tests
env:
ETH_RPC_URL: https://eth-mainnet.alchemyapi.io/v2/Lc7oIGYeL_QvInzI0Wiu_pOZZDEKBrdf
FORK_BLOCK: 13633752
jobs:
prepare-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v2
- name: Clone repositories for integration tests
run: make integration-tests-testdata
- id: set-matrix
run: echo "::set-output name=matrix::$(ls integration-tests/testdata | awk 'BEGIN { ORS = ""; print "["; } { print "/@"$0"/@"; } END { print "]"; }' | sed "s^\"^\\\\\"^g;s^/@/@^\",\"^g;s^/\@^\"^g")"
tests:
needs: prepare-matrix
runs-on: ubuntu-latest
strategy:
matrix:
repo: ${{fromJSON(needs.prepare-matrix.outputs.matrix)}}
steps:
# clone
- uses: actions/checkout@v2
- name: Clone repositories for integration tests testdata
run: make integration-tests-testdata
# some deps require node
- uses: actions/setup-node@v2
# install rust
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
# ..with caching
- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true
- name: Get git sha
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
# try to load `forge` from cache
- name: Cache forge
id: cache-forge
uses: actions/cache@v2
env:
cache-name: cache-forge
with:
path: ./target/release/forge
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ steps.vars.outputs.sha_short }}
# if couldn't get, install forge
- name: Install forge
if: steps.cache-forge.outputs.cache-hit != 'true'
run: cargo build --release --bin forge
- name: Test ${{ matrix.repo }}
run: ./test.sh ${{ matrix.repo }}
working-directory:
./integration-tests