-
Notifications
You must be signed in to change notification settings - Fork 318
149 lines (119 loc) · 3.82 KB
/
test.yaml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: Test
on:
push:
branches:
- master
- develop
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
functional:
runs-on: ubuntu-latest
strategy:
matrix:
group: [1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@v1
- name: Cache compiler installations
uses: actions/cache@v2
with:
path: |
~/.solcx
~/.vvm/vyper-*
key: ${{ runner.os }}-compiler-cache
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install ganache
run: npm install -g ganache
- name: Set up python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set pip cache directory path
id: pip-cache-dir-path
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Restore pip cache
uses: actions/cache@v2
id: pip-cache
with:
path: |
${{ steps.pip-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
${{ runner.os }}-pip-
- name: Get Month
id: get-month
run: echo "::set-output name=date::$(/bin/date -u "+%Y%m")"
shell: bash
- name: Restore duration cache
uses: actions/cache@v2
id: test_durations_cache
with:
path: .test_durations
key: ${{ runner.os }}-${{ steps.get-month.outputs.date }}-test-durations-cache-
- name: Check file existence
id: check_test_durations
uses: andstor/file-existence-action@v1
with:
files: .test_durations
- name: cat
if: steps.check_test_durations.outputs.files_exists == 'true'
run: cat .test_durations
- name: Install python dependencies
run: pip install -r requirements-dev.txt
- name: Install pytest-split
run: pip install pytest-split
- name: Compile Code
run: brownie compile --size
- name: Run Splitted Tests
if: steps.check_test_durations.outputs.files_exists == 'true'
run: brownie test tests/functional --gas --coverage --splits 6 --group ${{ matrix.group }};
- name: Run build test_duration
if: steps.check_test_durations.outputs.files_exists == 'false' # has to run on all, otherwise the first one that finishes creates an empty cache and lock the cache for others
id: build_cache_duration
run: brownie test tests/functional --store-durations --gas --coverage
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Cache compiler installations
uses: actions/cache@v2
with:
path: |
~/.solcx
~/.vvm/vyper-*
key: ${{ runner.os }}-compiler-cache
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install ganache
run: npm install -g [email protected]
- name: Set up python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set pip cache directory path
id: pip-cache-dir-path
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Restore pip cache
uses: actions/cache@v2
id: pip-cache
with:
path: |
${{ steps.pip-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
${{ runner.os }}-pip-
- name: Install python dependencies
run: pip install -r requirements-dev.txt
- name: Run Tests
run: brownie test tests/integration/ -s --revert-tb