Skip to content

Commit

Permalink
Added building job to CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
kisialiou committed Oct 21, 2024
1 parent 50e61fc commit f85b526
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/lints.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust testing
name: Rust testing and building

on:
push:
Expand All @@ -21,8 +21,26 @@ jobs:
with:
toolchain: 1.79.0
components: clippy
target: wasm32-unknown-unknown
override: true

- name: Run Clippy
run: |
make rust-lint-${{ matrix.component }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.79.0
target: wasm32-unknown-unknown
override: true

- name: Build Near contract
run: |
make rust-build-near
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
.PHONY: rust-lint rust-lint-near rust-lint-omni-relayer

OPTIONS = -D warnings -D clippy::pedantic -A clippy::missing_errors_doc -A clippy::must_use_candidate -A clippy::module_name_repetitions
LINT_OPTIONS = -D warnings -D clippy::pedantic -A clippy::missing_errors_doc -A clippy::must_use_candidate -A clippy::module_name_repetitions
RUSTFLAGS = -C link-arg=-s

NEAR_MANIFEST = ./near/Cargo.toml
OMNI_RELAYER_MANIFEST = ./omni-relayer/Cargo.toml

rust-lint: rust-lint-near #rust-lint-relayer

rust-lint-near:
cargo clippy --manifest-path ./near/Cargo.toml -- $(OPTIONS)
cargo clippy --manifest-path $(NEAR_MANIFEST) -- $(LINT_OPTIONS)

rust-lint-omni-relayer:
cargo clippy --manifest-path ./omni-relayer/Cargo.toml -- $(OPTIONS)
cargo clippy --manifest-path $(OMNI_RELAYER_MANIFEST) -- $(LINT_OPTIONS)

rust-build-near:
RUSTFLAGS='$(RUSTFLAGS)' cargo build --target wasm32-unknown-unknown --release --manifest-path $(NEAR_MANIFEST)

0 comments on commit f85b526

Please sign in to comment.