From 2ad3e61eaa3160cec3db269e4c756ecfd2b3c204 Mon Sep 17 00:00:00 2001 From: thedavidmeister Date: Wed, 28 Feb 2024 10:08:42 +0400 Subject: [PATCH] ci --- .github/workflows/docs.yaml | 27 ---------------- .github/workflows/manual-sol-artifacts.yaml | 35 ++++++++++++++++++++ .github/workflows/rainix.yaml | 31 ++++++++++++++++++ .github/workflows/slither.yaml | 8 ----- .github/workflows/snapshot.yaml | 28 ---------------- .github/workflows/test.yaml | 36 --------------------- 6 files changed, 66 insertions(+), 99 deletions(-) delete mode 100644 .github/workflows/docs.yaml create mode 100644 .github/workflows/manual-sol-artifacts.yaml create mode 100644 .github/workflows/rainix.yaml delete mode 100644 .github/workflows/slither.yaml delete mode 100644 .github/workflows/snapshot.yaml delete mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml deleted file mode 100644 index 25a8245f..00000000 --- a/.github/workflows/docs.yaml +++ /dev/null @@ -1,27 +0,0 @@ -name: Build docs - -on: - push: - branches: - - main - -jobs: - docs: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - name: Generate docs - run: forge doc -b - - name: Deploy to GitHub Pages - if: success() - uses: crazy-max/ghaction-github-pages@v3 - with: - target_branch: gh-pages - build_dir: docs/book - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/manual-sol-artifacts.yaml b/.github/workflows/manual-sol-artifacts.yaml new file mode 100644 index 00000000..7f772d82 --- /dev/null +++ b/.github/workflows/manual-sol-artifacts.yaml @@ -0,0 +1,35 @@ +name: Manual sol artifacts +on: + workflow_dispatch: + inputs: + network: + description: 'Network to deploy to' + required: true + type: choice + options: + - polygon + - songbird + - flare + +jobs: + deploy: + runs-on: ubuntu-latest + env: + DEPLOYMENT_KEY: ${{ github.ref == 'refs/heads/main' && secrets.PRIVATE_KEY || secrets.PRIVATE_KEY_DEV }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - uses: DeterminateSystems/nix-installer-action@v4 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + + - run: nix develop --command rainix-sol-prelude + - run: nix develop --command rainix-sol-artifacts + env: + ETH_RPC_URL: ${{ inputs.network == 'polygon' && secrets.CI_DEPLOY_POLYGON_RPC_URL || inputs.network == 'songbird' && secrets.CI_DEPLOY_SONGBIRD_RPC_URL || inputs.network == 'flare' && secrets.CI_DEPLOY_FLARE_RPC_URL || '' }} + # Flare has hardcoded api key https://flarescan.com/documentation/recipes/foundry-verification + ETHERSCAN_API_KEY: ${{ inputs.network == 'flare' && 'verifyContract' || secrets.EXPLORER_VERIFICATION_KEY }} + DEPLOY_VERIFIER: ${{ inputs.network == 'songbird' && 'blockscout' || inputs.network == 'polygon' && 'etherscan' || '' }} + DEPLOY_VERIFIER_URL: ${{ inputs.network == 'songbird' && 'https://songbird-explorer.flare.network/api' || inputs.network == 'flare' && 'https://api.routescan.io/v2/network/mainnet/evm/14/etherscan' || '' }} diff --git a/.github/workflows/rainix.yaml b/.github/workflows/rainix.yaml new file mode 100644 index 00000000..97d666b3 --- /dev/null +++ b/.github/workflows/rainix.yaml @@ -0,0 +1,31 @@ +name: Rainix CI +on: [push] + +jobs: + standard-tests: + strategy: + matrix: + os: [ubuntu-latest] + task: [rainix-sol-test, rainix-sol-static] + fail-fast: false + runs-on: ${{ matrix.os }} + env: + DEPLOYMENT_KEY: ${{ github.ref == 'refs/heads/main' && secrets.PRIVATE_KEY || secrets.PRIVATE_KEY_DEV }} + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@v4 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + + - run: nix develop --command rainix-sol-prelude + + - name: Run ${{ matrix.task }} + env: + ETH_RPC_URL: ${{ secrets.CI_DEPLOY_RPC_URL }} + ETHERSCAN_API_KEY: ${{ secrets.EXPLORER_VERIFICATION_KEY }} + DEPLOY_VERIFIER: 'etherscan' + run: nix develop --command ${{ matrix.task }} \ No newline at end of file diff --git a/.github/workflows/slither.yaml b/.github/workflows/slither.yaml deleted file mode 100644 index 50d96461..00000000 --- a/.github/workflows/slither.yaml +++ /dev/null @@ -1,8 +0,0 @@ -name: Slither Analysis -on: [push] -jobs: - slither-analyze: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: crytic/slither-action@v0.3.0 diff --git a/.github/workflows/snapshot.yaml b/.github/workflows/snapshot.yaml deleted file mode 100644 index 2d3f2dec..00000000 --- a/.github/workflows/snapshot.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Gas snapshot - -on: [push] - -env: - FOUNDRY_PROFILE: ci - -jobs: - snapshot: - strategy: - fail-fast: true - - name: Gas snapshot - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - - name: Foundry shallow install - run: forge install --shallow - - - name: Check gas snapshots - run: forge snapshot --check - id: snapshot diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index aa8907d7..00000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Test - -on: [push] - -env: - FOUNDRY_PROFILE: ci - -jobs: - test: - strategy: - fail-fast: true - - name: Tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - with: - version: nightly - - - name: Foundry shallow install - run: forge install --shallow - - - name: Run Forge fmt - run: forge fmt --check - id: fmt - - - name: Run Forge build - run: forge build --sizes - id: build - - - name: Run Forge tests - run: forge test -vvv --gas-report - id: test