-
Notifications
You must be signed in to change notification settings - Fork 35
54 lines (54 loc) · 2.11 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
# test works flow run unit, cmd, integration and testworld tests parallely in 4 jobs
on:
push:
branches: [develop, master]
pull_request:
name: Tests
jobs:
tests:
name: ${{ matrix.test }} tests on ${{ matrix.os }}
strategy:
matrix:
go-version: [1.15.x]
os: [ubuntu-latest]
test: [unit, cmd, integration, testworld]
runs-on: ${{ matrix.os }}
env:
GOPATH: ${{ github.workspace }}
MATRIX_TEST: ${{ matrix.test }}
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Check out code
uses: actions/checkout@v2
with:
path: ${{ env.GOPATH }}/src/github.com/${{ github.repository }}
fetch-depth: 0
- uses: actions/[email protected]
with:
path: ${{ env.GOPATH }}/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.test }}
- name: Run tests
run: |
if [ "${MATRIX_TEST}" != "unit" ]; then
[[ -s ${HOME}/.nvm/nvm.sh ]] && . ${HOME}/.nvm/nvm.sh # This loads NVM
nvm install 10.15.1 &> /dev/null
nvm alias default 10.15.1 &> /dev/null
npm install -g [email protected] &> /dev/null
sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume &> /dev/null
. ${HOME}/.nix-profile/etc/profile.d/nix.sh &> /dev/null
nix-env -iA cachix -f https://cachix.org/api/v1/install &> /dev/null
cachix use dapp &> /dev/null
git clone --recursive https://github.com/dapphub/dapptools ${HOME}/.dapp/dapptools &> /dev/null
bash -c "cd ${HOME}/.dapp/dapptools && git checkout b76035185e67be430d851af81ad62c5f42c3e965" &> /dev/null
nix-env -f ${HOME}/.dapp/dapptools -iA dapp seth solc &> /dev/null
fi
make install-deps &> /dev/null
test=${{ matrix.test }} make run-tests
- name: Upload coverage
run: bash <(curl -s https://codecov.io/bash)