Skip to content

Commit

Permalink
ci: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pandadefi committed Feb 2, 2023
1 parent 74364b2 commit 3048f16
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '16.x'

- name: Set yarn cache directory path
id: yarn-cache-dir-path
Expand Down
44 changes: 6 additions & 38 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ concurrency:
cancel-in-progress: true

jobs:

functional:
runs-on: ubuntu-latest
strategy:
matrix:
group: [1, 2, 3, 4, 5, 6]

group: ["base_fee_oracle", "registry", "strategy", "vault"]
steps:
- uses: actions/checkout@v1

Expand All @@ -33,7 +31,7 @@ jobs:
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
node-version: '16.x'

- name: Install ganache
run: npm install -g ganache
Expand All @@ -59,45 +57,15 @@ jobs:
${{ 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
- name: Run test functional
id: test_functional
run: brownie test tests/functional/${{ matrix.group }}

integration:
runs-on: ubuntu-latest
Expand All @@ -116,7 +84,7 @@ jobs:
- name: Setup node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
node-version: '16.x'

- name: Install ganache
run: npm install -g ganache-cli@6.12.1
Expand Down

0 comments on commit 3048f16

Please sign in to comment.