Skip to content

Commit

Permalink
Add ink! linting MVP stage
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichi committed Feb 17, 2022
1 parent 4195197 commit 82a8d4c
Show file tree
Hide file tree
Showing 32 changed files with 1,866 additions and 287 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
run: |
wasm-opt --version
cargo -vV
cargo install cargo-dylint dylint-link
cargo dylint --version
cargo run -- contract --version
cargo run -- contract new foobar
echo "[workspace]" >> foobar/Cargo.toml
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
run: |
wasm-opt --version
cargo -vV
cargo install cargo-dylint dylint-link
cargo dylint --version
cargo run -- contract --version
cargo run -- contract new foobar
echo "[workspace]" >> foobar/Cargo.toml
Expand Down
26 changes: 26 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ workflow:
- cargo -vV
- rustc -vV
- rustup show
- cargo dylint --version
- bash --version
- ./scripts/ci/pre_cache.sh
# global RUSTFLAGS overrides the linker args so this way is better to pass the flags
- printf '[build]\nrustflags = ["-C", "link-dead-code"]\n' > ${CARGO_HOME}/config
- sccache -s

# needed until https://github.com/mozilla/sccache/issues/1000 is fixed.
# this is unfortunate, since it disables `sccache` for this entire file.
- unset RUSTC_WRAPPER

- git show
rules:
- if: $CI_PIPELINE_SOURCE == "web"
Expand Down Expand Up @@ -81,6 +87,26 @@ clippy:

#### stage: test (all features)

test-dylint:
stage: test
<<: *docker-env
script:
- cd ink_linting/

# Installing these components here is necessary because
# `ink_linting/` has a fixed `rust-toolchain` file.
# We can't move this line to the Docker container, since
# that would then make it impossible to upgrade the
# `ink_linting/rust-toolchain` file while still having
# this CI job succeed.
- rustup component add rustfmt clippy rust-src

- cargo check --verbose
- cargo fmt --verbose --all -- --check
- cargo clippy --verbose -- -D warnings;

- cargo test --verbose --workspace --all-features

test:
stage: test
<<: *docker-env
Expand Down
Loading

0 comments on commit 82a8d4c

Please sign in to comment.