From a3cf4164d830f1271ddb82faee1629815e620872 Mon Sep 17 00:00:00 2001 From: Mikhail Melnik Date: Tue, 8 Aug 2023 23:35:22 +0400 Subject: [PATCH] use new auth and use modern ci syntax --- .github/actions/setup/action.yml | 25 ----------------- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 35 ----------------------- hardhat.networks.js | 3 ++ 4 files changed, 51 insertions(+), 60 deletions(-) delete mode 100644 .github/actions/setup/action.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml deleted file mode 100644 index 80e8ccc..0000000 --- a/.github/actions/setup/action.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Setup - -runs: - using: composite - steps: - - uses: actions/setup-node@v3 - with: - node-version: 16 - - - run: npm install -g yarn - shell: bash - - - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - shell: bash - - - uses: actions/cache@v3 - with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - run: yarn - shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0345713 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + cache: 'yarn' + - run: yarn + - run: yarn lint + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + cache: 'yarn' + - run: yarn + - run: yarn test + env: + RPC_AUTH_HEADER: ${{ secrets.RPC_AUTH_HEADER }} + MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} + AVAX_RPC_URL: ${{ secrets.AVAX_RPC_URL}} + ARBITRUM_RPC_URL: ${{ secrets.ARBITRUM_RPC_URL }} + + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + cache: 'yarn' + - run: yarn + - run: yarn coverage + env: + RPC_AUTH_HEADER: ${{ secrets.RPC_AUTH_HEADER }} + MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }} + AVAX_RPC_URL: ${{ secrets.AVAX_RPC_URL}} + ARBITRUM_RPC_URL: ${{ secrets.ARBITRUM_RPC_URL }} + - uses: codecov/codecov-action@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 8923b1f..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: CI - -on: - push: - branches: [ master ] - pull_request: - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/setup - - run: yarn lint - - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/setup - - run: echo ARBITRUM_RPC_URL=${{ secrets.ARBITRUM_RPC_URL }} >> .env - - run: echo AVAX_RPC_URL=${{ secrets.AVAX_RPC_URL }} >> .env - - run: echo MAINNET_RPC_URL=${{ secrets.MAINNET_RPC_URL }} >> .env - - run: yarn test - - coverage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/setup - - run: echo ARBITRUM_RPC_URL=${{ secrets.ARBITRUM_RPC_URL }} >> .env - - run: echo AVAX_RPC_URL=${{ secrets.AVAX_RPC_URL }} >> .env - - run: echo MAINNET_RPC_URL=${{ secrets.MAINNET_RPC_URL }} >> .env - - run: yarn coverage - - uses: codecov/codecov-action@v3 diff --git a/hardhat.networks.js b/hardhat.networks.js index 00d72d3..7cbe032 100644 --- a/hardhat.networks.js +++ b/hardhat.networks.js @@ -5,6 +5,9 @@ function register (name, chainId, url, privateKey, etherscanNetworkName, ethersc if (url && privateKey && etherscanKey) { networks[name] = { url, + httpHeaders: { + 'auth-key': process.env.RPC_AUTH_HEADER, + }, chainId, accounts: [privateKey], };