-
Notifications
You must be signed in to change notification settings - Fork 4
build: initial cargo workspace and build pipeline #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
db01058
Client library
gregorydemay 30dd56c
Types library
gregorydemay 7a41cfe
Added canister
gregorydemay 85b0109
Added toolchain
gregorydemay 0f4b8eb
dummy query
gregorydemay 3fbe3ff
conventional commit
gregorydemay 5634226
basic Rust pipeline
gregorydemay 523f8a7
failing test
gregorydemay a5b5d71
fix path to Github files
gregorydemay 94e90d5
fix test
gregorydemay d90bd76
ensure Candid canister interface is consistent
gregorydemay 0eee468
Integration tests crate
gregorydemay 54e2422
Setup Pocket IC
gregorydemay 527ad71
test client via Pocket IC
gregorydemay 497e8c4
Try to abstract transport
gregorydemay 04c1ecd
fix int test
gregorydemay aa94865
PocketIcRuntime
gregorydemay 2fe109b
linting
gregorydemay 418ba1d
formatting
gregorydemay 620879b
formatting
gregorydemay a27bb94
Pipeline for integration tests
gregorydemay 286d391
Adapt .gitignore
gregorydemay fd87e90
Fake reproducible build for now
gregorydemay fe7d1c6
add wasms dir
gregorydemay e3e96cf
fix path
gregorydemay cacfad8
fix path
gregorydemay d9cc0f2
add TODO for reproducible build
gregorydemay 1255a2b
Polishing with some basic docs
gregorydemay 1caccb6
added CODEOWNERS and dependabot config
gregorydemay 304f9ec
change pipeline name
gregorydemay 641f535
added licenses
gregorydemay 632fe57
Basic README and CHANGELOG files
gregorydemay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| * @dfinity/cross-chain-team |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: cargo | ||
| directory: "/" | ||
| schedule: | ||
| interval: weekly | ||
| time: "01:17" | ||
| open-pull-requests-limit: 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| name: 'SOL RPC' | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - v* | ||
| paths-ignore: | ||
| - "README.md" | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| RUSTFLAGS: "-Dwarnings" | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 'Checkout' | ||
| uses: actions/checkout@v4 | ||
| - name: 'Check code' | ||
| run: | | ||
| cargo fmt --all -- --check | ||
| cargo clippy --locked --verbose --tests --benches --workspace -- -D clippy::all | ||
| cargo clippy --locked --verbose --target wasm32-unknown-unknown -p sol_rpc_canister -- -D clippy::all | ||
|
|
||
| reproducible-build: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: 'Checkout' | ||
| uses: actions/checkout@v4 | ||
| # TODO XC-283: setup reproducible build with Docker | ||
| - name: Docker build | ||
| run: | | ||
| cargo build --locked --target wasm32-unknown-unknown --release --package sol_rpc_canister | ||
| gzip -fckn9 target/wasm32-unknown-unknown/release/sol_rpc_canister.wasm >./wasms/sol_rpc_canister.wasm.gz | ||
gregorydemay marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: 'Archive Artifact' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: sol_rpc_canister.wasm.gz | ||
| path: ./wasms/sol_rpc_canister.wasm.gz | ||
| if-no-files-found: error | ||
|
|
||
| - name: 'Add summary' | ||
| run: | | ||
| hash=`sha256sum ./wasms/sol_rpc_canister.wasm.gz` | ||
| echo "SHA-256 :hash: ${hash}" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| unit-tests: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: 'Checkout' | ||
| uses: actions/checkout@v4 | ||
| - name: 'Run unit tests' | ||
| run: cargo test --locked --workspace --exclude sol_rpc_int_tests | ||
|
|
||
| integration-tests: | ||
| needs: [ reproducible-build ] | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: 'Checkout' | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: 'Download Artifacts' | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: sol_rpc_canister.wasm.gz | ||
|
|
||
| - name: 'Set SOL_RPC_CANISTER_WASM_PATH for load_wasm' | ||
| run: | | ||
| echo "SOL_RPC_CANISTER_WASM_PATH=$GITHUB_WORKSPACE/sol_rpc_canister.wasm.gz" >> "$GITHUB_ENV" | ||
|
|
||
| - name: 'Install PocketIC server' | ||
| uses: dfinity/pocketic@main | ||
| with: | ||
| pocket-ic-server-version: "7.0.0" | ||
|
|
||
| - name: Cargo test | ||
| run: cargo test --package sol_rpc_int_tests -- --test-threads 2 --nocapture | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| name: PR title format | ||
| on: | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - edited | ||
| - synchronize | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| # When getting Rust dependencies, retry on network error: | ||
| CARGO_NET_RETRY: 10 | ||
| # Use the local .curlrc | ||
| CURL_HOME: . | ||
| TITLE: ${{ github.event.pull_request.title }} | ||
| jobs: | ||
| check: | ||
| name: conventional-pr-title:required | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # Conventional commit patterns: | ||
| # verb: description | ||
| # verb!: description of breaking change | ||
| # verb(scope): Description of change to $scope | ||
| # verb(scope)!: Description of breaking change to $scope | ||
| # verb: feat, fix, ... | ||
| # scope: refers to the part of code being changed. E.g. " (accounts)" or " (accounts,canisters)" | ||
| # !: Indicates that the PR contains a breaking change. | ||
| - run: | | ||
| if [[ "$TITLE" =~ ^(feat|fix|chore|build|ci|docs|style|refactor|perf|test)(\([-a-zA-Z0-9,]+\))?\!?\: ]]; then | ||
| echo pass | ||
| else | ||
| echo "PR title does not match conventions" | ||
| exit 1 | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.