Skip to content

Commit

Permalink
Fixed main CI pipeline (#255)
Browse files Browse the repository at this point in the history
* Testing another approach to fix master CI - minimal changes to make it
work

* Testing, do not merge

* Added slack notification.

* Typo in the Makefile

* Fixed Makefile

* Remove testing code

* Linter
  • Loading branch information
Marcin-Radecki authored Oct 10, 2024
1 parent 17ff9f6 commit 57ff87a
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 4 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/contracts-compile-and-deploy-to-devenv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Devenv - deploy contracts (on demand)

on:
workflow_dispatch:
workflow_call:

concurrency:
group: "${{ github.ref }}-${{ github.workflow }}"
Expand Down Expand Up @@ -68,6 +69,15 @@ jobs:
run: |
make deploy-eth NETWORK=sepolia
- name: Deploy eth contracts (TransferLimit)
shell: bash
env:
SEPOLIA_MNEMONIC: ${{ secrets.DEVENV_TESTNET_SEPOLIA_KEY }}
SEPOLIA_ACCOUNT_NUMBER: ${{ secrets.DEVENV_TESTNET_SEPOLIA_ACCOUNT_NUMBER }}
SEPOLIA_TOKEN_CONFIG_PATH: "../cfg/tokens_testnet.json"
run: |
make deploy-eth-transfer-limit NETWORK=sepolia
- name: Deploy azero contracts
shell: bash
run: |
Expand Down
44 changes: 42 additions & 2 deletions .github/workflows/on-master-branch-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ jobs:
uses: ./.github/workflows/_check-vars-and-secrets.yml
secrets: inherit

compile-contracts-and-deploy-to-devenv:
needs: [check-vars-and-secrets]
name: Compile contracts and deploy to devenv
uses: ./.github/workflows/contracts-compile-and-deploy-to-devenv.yml
secrets: inherit

test-azero-contracts:
needs: [check-vars-and-secrets]
uses: ./.github/workflows/test-azero-contracts.yml
Expand All @@ -21,13 +27,47 @@ jobs:
uses: ./.github/workflows/test-eth-contracts.yml

build-l1-relayer:
needs: [test-eth-contracts, test-azero-contracts]
needs:
- test-eth-contracts
- test-azero-contracts
- compile-contracts-and-deploy-to-devenv
name: Build L1 relayer
uses: ./.github/workflows/l1-relayer-build.yml
secrets: inherit

build-l2-relayer:
needs: [test-eth-contracts, test-azero-contracts]
needs:
- test-eth-contracts
- test-azero-contracts
- compile-contracts-and-deploy-to-devenv
name: Build L2 relayer
uses: ./.github/workflows/l2-relayer-build.yml
secrets: inherit

check-pipeline-completion:
needs: [build-l1-relayer,
build-l2-relayer]
name: Check pipeline completion
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: All nightly tests completed
run: |
# due to the fact GitHub treats skipped jobs as success, and when any of dependant
# jobs fail, this check will be skipped, we need to check status manually
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
slack:
name: Slack notification
runs-on: ubuntu-latest
needs: [check-pipeline-completion]
if: >
!cancelled() &&
github.event_name != 'workflow_dispatch'
steps:
- name: Send Slack message
uses: Cardinal-Cryptography/github-actions/slack-notification@v7
with:
notify-on: "failure"
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_DEV_ONDUTY }}
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,13 @@ compile-eth: eth-deps
deploy-eth: # Deploy eth contracts
deploy-eth: compile-eth
cd eth && \
npx hardhat run --network $(NETWORK) scripts/0_deploy_bridge_contracts.js \
&& npx hardhat run --network $(NETWORK) scripts/deploy_transfer_limit.js
npx hardhat run --network $(NETWORK) scripts/0_deploy_bridge_contracts.js

.PHONY: deploy-eth-transfer-limit
deploy-eth-transfer-limit: # Deploy TransferLimit eth contract
deploy-eth-transfer-limit: compile-eth
cd eth && \
npx hardhat run --network $(NETWORK) scripts/deploy_transfer_limit.js

.PHONY: upload-eth
upload-eth: # Upload the MOST contract to a live ethereum network (testnet or mainnet) for an upgrade
Expand Down
3 changes: 3 additions & 0 deletions eth/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ if (SEPOLIA_MNEMONIC || SEPOLIA_PRIVATE_KEY) {
mnemonic: SEPOLIA_MNEMONIC,
}
: [SEPOLIA_PRIVATE_KEY],
gasPrice: 10e9, // 10 Gwei; it's set to have an upper bound for contract deployment costs
timeout: 20000, // 20s; if gas prices are higher than 20 Gwei, any tx would likely
// become stuck in the mempool, hence we need a timeout for a deployment script to finish
deploymentConfig: {
guardianIds: [
typeof SEPOLIA_ACCOUNT_NUMBER == "undefined" ||
Expand Down

0 comments on commit 57ff87a

Please sign in to comment.