Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e71115d
wait for finalization
fbielejec Oct 26, 2022
75ed49b
say no to oncurrent jobs
fbielejec Oct 26, 2022
4319384
trigger, remove labels
fbielejec Oct 26, 2022
3eca2eb
OK
fbielejec Oct 26, 2022
3992fe2
Merge branch 'benjamin' into fix-e2e
fbielejec Oct 26, 2022
a01b1fd
wtf
fbielejec Oct 26, 2022
d8cd778
show networks
fbielejec Oct 26, 2022
8841ccc
rerun
fbielejec Oct 26, 2022
9e6f1ab
short lived wf
fbielejec Oct 26, 2022
6a39be2
run it
fbielejec Oct 26, 2022
86b52a4
need code
fbielejec Oct 26, 2022
2bcced3
just use host
fbielejec Oct 26, 2022
55aaaef
mhm
fbielejec Oct 26, 2022
c4f86a0
co tu sie
fbielejec Oct 26, 2022
b16e4fe
debug
fbielejec Oct 26, 2022
24cd7ed
get a shell
fbielejec Oct 26, 2022
2607a3d
add missing flag
fbielejec Oct 26, 2022
fe78a4f
aaaaaa
fbielejec Oct 26, 2022
b827a29
get shell
fbielejec Oct 26, 2022
44a72db
show me the logs
fbielejec Oct 26, 2022
3c4a3c7
docke rnet
fbielejec Oct 26, 2022
52d6a89
fixit
fbielejec Oct 26, 2022
ed450be
off you go
fbielejec Oct 26, 2022
0d767f6
yesh
fbielejec Oct 26, 2022
e363769
test workflow dispatch
fbielejec Oct 26, 2022
47c790a
deployment triggered by tests
fbielejec Oct 26, 2022
b83f7af
cleanup
fbielejec Oct 26, 2022
698428f
TODOs
fbielejec Oct 27, 2022
5aff6c1
try the trigger
fbielejec Oct 27, 2022
8d41a20
add dispatch trigger
fbielejec Oct 27, 2022
7fbae16
Blend contracts e2e tests and deployment workflows into one workflow
keenbytes Oct 27, 2022
b1a7d6f
Oops! Remove duplicated workflow
keenbytes Oct 27, 2022
6277e75
addressing comments
fbielejec Oct 27, 2022
6a282a6
Add triggering indexer deployment workflow
keenbytes Oct 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
OK
  • Loading branch information
fbielejec committed Oct 26, 2022
commit 3eca2eb71e418dfe9be76faf465a5e16148f415c
7 changes: 4 additions & 3 deletions .github/scripts/check_finalization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

## USAGE
## .github/scripts/check_finalization.sh <rpc-host> <rpc-port>
## if <rpc-host> <rpc-port> are empty default values will be used (127.0.0.1 and 9933)
## if <rpc-host> <rpc-port> <network> are empty default values will be used (127.0.0.1, 9933 and host)
##

RPC_HOST=${1:-127.0.0.1}
RPC_PORT=${2:-9933}
NETWORK=${3:-host}

LAST_FINALIZED=""

while [[ "$LAST_FINALIZED" =~ "0x0" ]] || [[ -z "$LAST_FINALIZED" ]]; do
block_hash=$(docker run --network host appropriate/curl:latest \
block_hash=$(docker run --network $NETWORK appropriate/curl:latest \
-H "Content-Type: application/json" \
-d '{"id":1, "jsonrpc":"2.0", "method": "chain_getFinalizedHead"}' http://$RPC_HOST:$RPC_PORT | jq '.result')
ret_val=$?
Expand All @@ -20,7 +21,7 @@ while [[ "$LAST_FINALIZED" =~ "0x0" ]] || [[ -z "$LAST_FINALIZED" ]]; do
continue
fi

finalized_block=$(docker run --network host appropriate/curl:latest \
finalized_block=$(docker run --network $NETWORK appropriate/curl:latest \
-H "Content-Type: application/json" \
-d '{"id":1, "jsonrpc":"2.0", "method": "chain_getBlock", "params": ['$block_hash']}' http://$RPC_HOST:$RPC_PORT | jq '.result.block.header.number')

Expand Down
26 changes: 4 additions & 22 deletions .github/workflows/deploy-the-button.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,30 @@ on:
workflows: [e2e-tests-contracts]
types:
- completed
branches:
- benjamin

# allow only once run instance of this workflow ever
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false

env:
CHECKOUT_REF: benjamin
CHECKOUT_BRANCH: benjamin
CACHE_KEY: fe-benjamin-button
CONTRACTS_ENVFILE: fe-benjamin
CARGOCONTRACT_REV: 2b1758756de59bd81e7bed5f8429d364f281cb9a
NODE_VERSION: 16
S3BUCKET_PATH: contracts/fe-benjamin-button
# LABEL_DEPLOY_CONTRACTS: '[AZERO] DEPLOY-CONTRACTS'
# LABEL_DESTROYED: 'DESTROYED'
# LABEL_DEPLOYED: 'DEPLOYED'
# LABEL_DEPLOYED_CONTRACTS: 'DEPLOYED-CONTRACTS'

jobs:
build_and_deploy_contracts:
# if: (github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == '[AZERO] DEPLOY-CONTRACTS')
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/[email protected]
with:
ref: ${{ env.CHECKOUT_REF }}
ref: ${{ env.CHECKOUT_BRANCH }}

- name: Check if environment is reachable
shell: bash
Expand Down Expand Up @@ -101,15 +98,13 @@ jobs:
aws-region: ${{ env.AWS_REGION }}

- name: Get contracts' target directories cache from S3 bucket
# if: (github.event_name == 'push') || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, env.LABEL_DEPLOYED_CONTRACTS))
shell: bash
continue-on-error: true
run: |
aws s3 cp s3://${{ secrets.CI_S3BUCKET_NAME }}/${{ env.S3BUCKET_PATH }}/targets.tgz targets.tgz
tar -xzf targets.tgz

- name: Copy metadata.json and addresses.json files from S3 bucket
# if: (github.event_name == 'push') || (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, env.LABEL_DEPLOYED_CONTRACTS))
shell: bash
run: |
aws s3 cp s3://${{ secrets.CI_S3BUCKET_NAME }}/${{ env.S3BUCKET_PATH }}/addresses.json contracts/addresses.json
Expand Down Expand Up @@ -184,19 +179,6 @@ jobs:
-H 'Authorization: Bearer ${{ secrets.CI_GH_TOKEN }}' \
-d '{ "ref":"main", "inputs": { "buildImage": "false", "deployImage": "true", "buildFEBenjaminImage": "true", "deployFEBenjaminImage": "true" }}'

# - name: Add label to mark that contracts have been deployed
# uses: actions-ecosystem/[email protected]
# with:
# labels: ${{ env.LABEL_DEPLOYED_CONTRACTS }}
# github_token: ${{ secrets.CI_GH_TOKEN }}

# - name: Remove request label if exists
# if: contains(github.event.pull_request.labels.*.name, env.LABEL_DEPLOY_CONTRACTS)
# uses: actions-ecosystem/[email protected]
# with:
# labels: ${{ env.LABEL_DEPLOY_CONTRACTS }}
# github_token: ${{ secrets.CI_GH_TOKEN }}

- name: Create empty target directory so that restore-cache does not fail
run: |
mkdir -p target
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/e2e-tests-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ on:
- 'contracts/**'
- '.github/**'
push:
branches:
- benjamin
paths:
- 'contracts/**'
- '.github/**'
workflow_dispatch:
branches:
- benjamin

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
Expand Down Expand Up @@ -41,6 +40,7 @@ jobs:
- name: Checkout Source code
uses: actions/checkout@v3


- name: Install Rust Toolchain
uses: actions-rs/toolchain@v1

Expand Down Expand Up @@ -88,8 +88,9 @@ jobs:
# wait some while docker pulls the image and starts the node
- name: Wait for finalization
shell: bash
run: ./.github/scripts/check_finalization.sh

run: .github/scripts/check_finalization.sh smartnode 9933 node-network
timeout-minutes: 1

- name: Run e2e tests
shell: bash
run: |
Expand Down