Skip to content

Commit

Permalink
tests: split env.
Browse files Browse the repository at this point in the history
  • Loading branch information
stas committed Oct 29, 2024
1 parent dc64626 commit b078c88
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 81 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@ name: CI
on: [push, pull_request]

jobs:
ci:
chains_matrix:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}

strategy:
matrix:
chain: ['optimism', 'base', 'mode', 'bob']
experimental: [false]
include:
- chain: 'mode'
experimental: true
- chain: 'bob'
experimental: true

steps:
- uses: actions/checkout@master

- name: Builds the Docker image
run: docker build ./ -t velodrome/sugar

- name: Runs code QA and tests for optimism
run: docker run --rm --env-file=env.example -e CHAIN_ID=10 -v $(pwd):/app -w /app -t velodrome/sugar sh -c 'flake8 && brownie test --network=optimism-main'
- name: Runs code QA and tests for base
run: docker run --rm --env-file=env.example -e CHAIN_ID=8453 -v $(pwd):/app -w /app -t velodrome/sugar sh -c 'flake8 && brownie test --network=base-main'
- name: Runs code QA and sugar factory registry tests
run: docker run --rm --env-file=env.example -e CHAIN_ID=34443 -v $(pwd):/app -w /app -t velodrome/sugar sh -c 'flake8 && brownie test --network=mode-main'
- name: Runs code QA and tests
run: docker run --rm --env-file=env.{{ matrix.chain }} -v $(pwd):/app -w /app -t velodrome/sugar sh -c 'flake8 && brownie test --network={{ matrix.chain }}-main'
20 changes: 20 additions & 0 deletions env.base
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CHAIN_ID=8453
CONTRACT='lp'

VOTER_8453=0x16613524e02ad97eDfeF371bC883F2F5d6C480A5
REGISTRY_8453=0x5C3F18F06CC09CA1910767A34a20F771039E37C0
CONVERTOR_8453=0x1111111111111111111111111111111111111111
SLIPSTREAM_HELPER_8453=0x6d2D739bf37dFd93D804523c2dfA948EAf32f8E1
ALM_FACTORY_8453=0x5B1b1aaC71bDca9Ed1dCb2AA357f678584db4029
DIST_8453=0x227f65131A261548b057215bB1D5Ab2997964C7d
RELAY_REGISTRY_ADDRESSES_8453=0x05e41604B9463e2224227053980dfF3f57fb6dB5,0xD308aBCe663302d3b86b36d332CEFd8A4F62C5Ed
GOVERNOR_8453=0x94C012A23A8A65A6f40608dA30534a46a433F410

TEST_FACTORY_ADDRESS_8453=0x5e7BB104d84c7CB9B682AaC2F3d509f5F406809A
TEST_ADDRESS_8453=0x892Ff98a46e5bd141E2D12618f4B2Fe6284debac
TEST_ALM_ADDRESS_8453=0x892Ff98a46e5bd141E2D12618f4B2Fe6284debac

LP_SUGAR_ADDRESS_8453=0xC9611f3191073EE063a6AFDc6b58b660e8C90afE
REWARDS_SUGAR_ADDRESS_8453=0xEbfD2d983340e0bA6109a387928ADAe9FEE47D4b
VE_SUGAR_ADDRESS_8453=0x4c5d3925fe65DFeB5A079485136e4De09cb664A5
RELAY_SUGAR_ADDRESS_8453=0x8932B5FE23C07Df06533F8f09E43e7cca6a24143
17 changes: 17 additions & 0 deletions env.bob
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
CHAIN_ID=60808
CONTRACT='lp'

VOTER_60808=0x0000000000000000000000000000000000000000
REGISTRY_60808=0x0000000000000000000000000000000000000000
CONVERTOR_60808=0x1111111111111111111111111111111111111111
SLIPSTREAM_HELPER_60808=0x0000000000000000000000000000000000000000
ALM_FACTORY_60808=0x0000000000000000000000000000000000000000
FACTORIES_60808=
DIST_60808=0x0000000000000000000000000000000000000000
RELAY_REGISTRY_ADDRESSES_60808=
GOVERNOR_60808=0x1111111111111111111111111111111111111111

LP_SUGAR_ADDRESS_60808=
REWARDS_SUGAR_ADDRESS_60808=
VE_SUGAR_ADDRESS_60808=
RELAY_SUGAR_ADDRESS_60808=
72 changes: 0 additions & 72 deletions env.example

This file was deleted.

17 changes: 17 additions & 0 deletions env.mode
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
CHAIN_ID=34443
CONTRACT='lp'

VOTER_34443=0x0000000000000000000000000000000000000000
REGISTRY_34443=0x6B290762F9F9155637F0Bb6B7A5B1cEb394cceD8
CONVERTOR_34443=0x1111111111111111111111111111111111111111
SLIPSTREAM_HELPER_34443=0x0000000000000000000000000000000000000000
ALM_FACTORY_34443=0x0000000000000000000000000000000000000000
FACTORIES_34443=
DIST_34443=0x0000000000000000000000000000000000000000
RELAY_REGISTRY_ADDRESSES_34443=
GOVERNOR_34443=0x1111111111111111111111111111111111111111

LP_SUGAR_ADDRESS_34443=
REWARDS_SUGAR_ADDRESS_34443=
VE_SUGAR_ADDRESS_34443=
RELAY_SUGAR_ADDRESS_34443=
20 changes: 20 additions & 0 deletions env.optimism
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CHAIN_ID=10
CONTRACT='lp'

VOTER_10=0x41C914ee0c7E1A5edCD0295623e6dC557B5aBf3C
REGISTRY_10=0xF4c67CdEAaB8360370F41514d06e32CcD8aA1d7B
CONVERTOR_10=0x585Af0b397AC42dbeF7f18395426BF878634f18D
SLIPSTREAM_HELPER_10=0x5Bd7E2221C2d59c99e6A9Cd18D80A5F4257D0f32
ALM_FACTORY_10=0xeD8b81E3fF6c54951621715F5992CA52007D88bA
DIST_10=0x9D4736EC60715e71aFe72973f7885DCBC21EA99b
RELAY_REGISTRY_ADDRESSES_10=0xe9F00f2e61CB0c6fb00A2e457546aCbF0fC303C2,0x6b1253B116B5919932399295C75116d33F8EfF96
GOVERNOR_10=0x1F82e10D58aEf03DeA2e478029fB0387A1cbE989

TEST_FACTORY_ADDRESS_10=0xCc0bDDB707055e04e497aB22a59c2aF4391cd12F
TEST_ADDRESS_10=0x892ff98a46e5bd141e2d12618f4b2fe6284debac
TEST_ALM_ADDRESS_10=0x892ff98a46e5bd141e2d12618f4b2fe6284debac

LP_SUGAR_ADDRESS_10=0xd0bF8A2e7ECAC81106b3A1A341299E9314219598
REWARDS_SUGAR_ADDRESS_10=0xc4e64A0B93713a9be19B1ccdA408F76923202B73
VE_SUGAR_ADDRESS_10=0x94f913362b232e31daB49a1aFB775cfd25DaA6a1
RELAY_SUGAR_ADDRESS_10=0xb8307e5842B9aeE75C704183F0355076aa74b4e2
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,13 @@ docker build ./ -t velodrome/sugar

Next start the container with existing environment variables:
```sh
docker run --env-file=env.example --rm -v $(pwd):/app -w /app -it velodrome/sugar sh
docker run --env-file=env.{{chain}} --rm -v $(pwd):/app -w /app -it velodrome/sugar sh
```
The environment has Brownie and Vyper already installed.

To run the tests inside the container, use:
```sh
brownie test --network=optimism-test
brownie test --network={{chain}}-test
```

## Why the contracts are not verified?
Expand Down

0 comments on commit b078c88

Please sign in to comment.