Skip to content

Commit b47b3d8

Browse files
authored
Merge pull request #1 from babylonlabs-io/f/add-ci
F/add CI
2 parents 881c3ec + 58e1058 commit b47b3d8

File tree

3 files changed

+135
-0
lines changed

3 files changed

+135
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: babylonlabs/op-finality-gadget/deploy
2+
on:
3+
push:
4+
tags:
5+
- 'v*.*.*'
6+
env:
7+
CARGO_TERM_COLOR: always
8+
WORKSPACE: "/home/runner/work/op-finality-gadget/op-finality-gadget"
9+
jobs:
10+
build_and_upload_contracts:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
packages: read
14+
pull-requests: read
15+
contents: write
16+
deployments: write
17+
pages: write
18+
repository-projects: write
19+
statuses: write
20+
steps:
21+
- uses: actions/[email protected]
22+
- name: Build optimised Wasm binaries
23+
run: "./scripts/optimizer.sh"
24+
- uses: actions/[email protected]
25+
with:
26+
path: |-
27+
artifacts/op_finality_gadget.wasm
28+
artifacts/checksums.txt
29+
- name: Show data
30+
run: |-
31+
ls -l artifacts
32+
cat artifacts/checksums.txt
33+
- name: Zip artifacts
34+
run: |-
35+
zip ./op_finality_gadget.wasm.zip artifacts/op_finality_gadget.wasm
36+
- name: Create a Release
37+
id: create-release
38+
uses: actions/create-release@v1
39+
env:
40+
GITHUB_TOKEN: ${{ github.token }}
41+
with:
42+
tag_name: ${{ github.ref_name }}
43+
release_name: Release ${{ github.ref_name }}
44+
body: |
45+
Attached there are some build artifacts generated at this tag.
46+
draft: false
47+
prerelease: false
48+
- name: Upload op_finality_gadget
49+
id: upload-op_finality_gadget
50+
uses: actions/upload-release-asset@v1
51+
env:
52+
GITHUB_TOKEN: ${{ github.token }}
53+
with:
54+
upload_url: ${{ steps.create-release.outputs.upload_url }}
55+
asset_path: ./op_finality_gadget.wasm.zip
56+
asset_name: op_finality_gadget.wasm.zip
57+
asset_content_type: application/zip
58+
- name: Upload checksums
59+
id: upload-checksums
60+
uses: actions/upload-release-asset@v1
61+
env:
62+
GITHUB_TOKEN: ${{ github.token }}
63+
with:
64+
upload_url: ${{ steps.create-release.outputs.upload_url }}
65+
asset_path: ./artifacts/checksums.txt
66+
asset_name: checksums.txt
67+
asset_content_type: text/plain
68+
- name: Build and run schema generator
69+
run: |-
70+
(cd ./contracts/op-finality-gadget && cargo run --bin schema)
71+
- name: Consolidate schemas
72+
run: |-
73+
mkdir -p ./schemas
74+
cp -a ./contracts/*/schema/* ./schemas
75+
- name: Show data
76+
run: ls -l ./schemas
77+
- name: Zip schemas
78+
run: |-
79+
zip -r ./schemas.zip schemas/
80+
- name: Upload schemas
81+
id: upload-schemas
82+
uses: actions/upload-release-asset@v1
83+
env:
84+
GITHUB_TOKEN: ${{ github.token }}
85+
with:
86+
upload_url: ${{ steps.create-release.outputs.upload_url }}
87+
asset_path: ./schemas.zip
88+
asset_name: schemas.zip
89+
asset_content_type: application/zip

.github/workflows/local-tests.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: babylonlabs/op-finality-gadget/local-tests
2+
on:
3+
pull_request:
4+
branches:
5+
- '**'
6+
env:
7+
CARGO_TERM_COLOR: always
8+
jobs:
9+
local-build-test:
10+
runs-on: ubuntu-latest
11+
container:
12+
image: rust:1.86.0
13+
steps:
14+
- uses: actions/[email protected]
15+
- name: Build contracts, check formats, and run unit tests
16+
run: |
17+
rustup component add rustfmt
18+
cargo fmt -- --check
19+
cargo test --lib
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: babylonlabs/op-finality-gadget/wasm-tests-full
2+
on:
3+
pull_request:
4+
branches:
5+
- '**'
6+
env:
7+
CARGO_TERM_COLOR: always
8+
WORKSPACE: "/home/runner/work/op-finality-gadget/op-finality-gadget"
9+
jobs:
10+
wasm-build-check-integration-full:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/[email protected]
14+
- name: Build optimised Wasm binaries
15+
run: "./scripts/optimizer.sh"
16+
- name: List optimised Wasm binaries
17+
run: bash -c "ls $WORKSPACE/artifacts/*.wasm"
18+
- name: Install cosmwasm-check
19+
run: cargo install --locked --debug --version ^2.0 cosmwasm-check
20+
- name: Check the Wasm binaries' validity
21+
run: bash -c "cosmwasm-check $WORKSPACE/artifacts/*.wasm"
22+
- name: Integration tests based on CosmWasm
23+
run: cargo test --test integration
24+
- uses: actions/[email protected]
25+
with:
26+
path: |-
27+
artifacts/op_finality_gadget.wasm

0 commit comments

Comments
 (0)