From 8cd984a468152c64016981d6f6b08e06f4092074 Mon Sep 17 00:00:00 2001 From: Daniel Schiavini Date: Thu, 11 Jan 2024 13:09:35 +0100 Subject: [PATCH] Merge CI scripts --- .github/tentative_workflows/test_factory.yaml | 49 -------------- .github/tentative_workflows/test_gauge.yaml | 44 ------------- .github/tentative_workflows/test_pools_2.yaml | 41 ------------ .github/tentative_workflows/test_token.yaml | 35 ---------- .github/workflows/ci.yaml | 66 +++++++++++++++++++ .github/workflows/lint.yaml | 18 ----- 6 files changed, 66 insertions(+), 187 deletions(-) delete mode 100644 .github/tentative_workflows/test_factory.yaml delete mode 100644 .github/tentative_workflows/test_gauge.yaml delete mode 100644 .github/tentative_workflows/test_pools_2.yaml delete mode 100644 .github/tentative_workflows/test_token.yaml create mode 100644 .github/workflows/ci.yaml delete mode 100644 .github/workflows/lint.yaml diff --git a/.github/tentative_workflows/test_factory.yaml b/.github/tentative_workflows/test_factory.yaml deleted file mode 100644 index ed7eca94..00000000 --- a/.github/tentative_workflows/test_factory.yaml +++ /dev/null @@ -1,49 +0,0 @@ -name: test_factory - -on: - pull_request: - paths: - - "tests/test_factory.py" - - "contracts/CurveStableSwapFactoryNG.vy" - push: - paths: - - "tests/test_factory.py" - - "contracts/CurveStableSwapFactoryNG.vy" - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WEB3_PROVIDER_URL: ${{ secrets.WEB3_PROVIDER_URL }} - -jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Cache Compiler Installations - uses: actions/cache@v3 - with: - path: | - ~/.vvm - key: compiler-cache - - - name: Setup Python 3.10.4 - uses: actions/setup-python@v4 - with: - python-version: 3.10.4 - - - name: Install Requirements - run: | - pip install poetry==1.5.1 - poetry config virtualenvs.in-project true - poetry install --no-interaction --without dev - - - name: Run Tests Basic - run: | - source .venv/bin/activate - pytest tests/test_factory.py --token-types=plain -n auto - - - name: Run Tests Forked - run: | - source .venv/bin/activate - pytest tests/test_factory_forked.py --token-types=plain -n auto diff --git a/.github/tentative_workflows/test_gauge.yaml b/.github/tentative_workflows/test_gauge.yaml deleted file mode 100644 index fbb3f03c..00000000 --- a/.github/tentative_workflows/test_gauge.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: test_gauge - -on: - pull_request: - paths: - - "tests/gauge/*.py" - - "contracts/LiquidityGauge.vy" - push: - paths: - - "tests/gauge/*.py" - - "contracts/LiquidityGauge.vy" - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WEB3_PROVIDER_URL: ${{ secrets.WEB3_PROVIDER_URL }} - -jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Cache Compiler Installations - uses: actions/cache@v3 - with: - path: | - ~/.vvm - key: compiler-cache - - - name: Setup Python 3.10.4 - uses: actions/setup-python@v4 - with: - python-version: 3.10.4 - - - name: Install Requirements - run: | - pip install poetry==1.5.1 - poetry config virtualenvs.in-project true - poetry install --no-interaction --without dev - - - name: Run Tests - run: | - source .venv/bin/activate - pytest tests/gauge/ --pool-size=2 --pool-type=basic --token-types=plain --decimals=18,18 -n auto diff --git a/.github/tentative_workflows/test_pools_2.yaml b/.github/tentative_workflows/test_pools_2.yaml deleted file mode 100644 index ca96f01b..00000000 --- a/.github/tentative_workflows/test_pools_2.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: test_pools_2 - -on: [pull_request, push] - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WEB3_PROVIDER_URL: ${{ secrets.WEB3_PROVIDER_URL }} - -jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Cache Compiler Installations - uses: actions/cache@v3 - with: - path: | - ~/.vvm - key: compiler-cache - - - name: Setup Python 3.10.4 - uses: actions/setup-python@v4 - with: - python-version: 3.10.4 - - - name: Install Requirements - run: | - pip install poetry==1.5.1 - poetry config virtualenvs.in-project true - poetry install --no-interaction --without dev - - - name: Run All Token Tests 18,18 - run: | - source .venv/bin/activate - pytest tests/pools/ --pool-size=2 -n auto - - - name: Run Plain Tests 18,6 - run: | - source .venv/bin/activate - pytest tests/pools/ --pool-size=2 --pool-type=basic --token-types=plain --decimals=18,6 -n auto diff --git a/.github/tentative_workflows/test_token.yaml b/.github/tentative_workflows/test_token.yaml deleted file mode 100644 index 49bd91fe..00000000 --- a/.github/tentative_workflows/test_token.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: test_token - -on: [pull_request, push] - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Cache Compiler Installations - uses: actions/cache@v3 - with: - path: | - ~/.vvm - key: compiler-cache - - - name: Setup Python 3.10.4 - uses: actions/setup-python@v4 - with: - python-version: 3.10.4 - - - name: Install Requirements - run: | - pip install poetry==1.5.1 - poetry config virtualenvs.in-project true - poetry install --no-interaction --without dev - - - name: Run Tests - run: | - source .venv/bin/activate - pytest tests/test_token.py --token-types=plain -n auto diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..3e20029d --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,66 @@ +name: lint + +on: [push] + +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Setup Python 3.10.4 + uses: actions/setup-python@v4 + with: + python-version: 3.10.4 + + - uses: pre-commit/action@v3.0.0 + + tests: + runs-on: ubuntu-latest + strategy: + matrix: + name: + - gauge + - pools + - factory + include: + - name: gauge + tests: tests/gauge/ + - name: pools + tests: tests/pools/ + - name: factory + tests: >- + tests/test_factory.py + tests/test_factory_forked.py + tests/test_get_D.py + tests/test_token.py + + steps: + - uses: actions/checkout@v3 + + - name: Cache Compiler Installations + uses: actions/cache@v3 + with: + path: ~/.vvm + key: compiler-cache + + - name: Setup Python 3.10.4 + uses: actions/setup-python@v4 + with: + python-version: 3.10.4 + + - name: Install Requirements + run: | + pip install poetry==1.5.1 + poetry config virtualenvs.in-project true + poetry install --no-interaction --without dev + + - name: Run Tests + run: | + source .venv/bin/activate + pytest -n auto ${{ matrix.tests }} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index a0d59e2c..00000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: lint - -on: [pull_request, push] - -jobs: - - lint: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - - name: Setup Python 3.10.4 - uses: actions/setup-python@v4 - with: - python-version: 3.10.4 - - - uses: pre-commit/action@v3.0.0