Skip to content

Commit

Permalink
Experiment with CI
Browse files Browse the repository at this point in the history
  • Loading branch information
cmichi committed Feb 16, 2022
1 parent 9825836 commit e76bce7
Show file tree
Hide file tree
Showing 16 changed files with 4,893 additions and 66 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ jobs:
run: |
wasm-opt --version
cargo -vV
cargo install cargo-dylint dylint-link
cargo dylint --version
rustup component add rust-src
cargo run -- contract --version
cargo run -- contract new foobar
echo "[workspace]" >> foobar/Cargo.toml
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
run: |
wasm-opt --version
cargo -vV
cargo install cargo-dylint dylint-link
cargo dylint --version
rustup component add rust-src
cargo run -- contract --version
cargo run -- contract new foobar
echo "[workspace]" >> foobar/Cargo.toml
Expand Down
47 changes: 23 additions & 24 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


stages:
- check
- test
- build

Expand Down Expand Up @@ -39,11 +38,20 @@ 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
- unset RUSTC_WRAPPER
#- unset CARGO_TARGET_DIR
#- unset CARGO_HOME
- rustup component add rustfmt
- rustup component add clippy
- rustup component add rust-src rustc-dev llvm-tools-preview
- clang --version
- cc --version
- git show
rules:
- if: $CI_PIPELINE_SOURCE == "web"
Expand All @@ -64,28 +72,29 @@ workflow:
- linux-docker


#### stage: check
# be aware that the used image has cargo-contract installed
#### stage: test (all features)

fmt:
stage: check
test-dylint:
stage: test
<<: *docker-env
script:
- cd dylint/
- rustup component add rustfmt
- rustup component add clippy
- rustup component add rust-src rustc-dev llvm-tools-preview
- git show
- cargo check --verbose
- cargo fmt --verbose --all -- --check
- cargo clippy --verbose -- -D warnings;
- RUSTC_WRAPPER="" cargo test --verbose --workspace --all-features

clippy:
stage: check
<<: *docker-env
script:
- cargo clippy --verbose --all-targets --all-features -- -D warnings;

#### stage: test (all features)

test:
stage: test
<<: *docker-env
script:
- cargo test --verbose --workspace --all-features
#- rm -rf /ci-cache/cargo-contract/targets/431/test/
- RUST_LOG=info cargo test --jobs 1 --verbose --workspace --all-features -- --nocapture --test-threads=1

test-new-project-template:
stage: test
Expand All @@ -97,6 +106,7 @@ test-new-project-template:
# `error: current package believes it's in a workspace when it's not`
- echo "[workspace]" >> new_project/Cargo.toml

- cargo run --all-features -- contract build --manifest-path new_project/Cargo.toml
- cargo run --all-features -- contract build --manifest-path new_project/Cargo.toml
- cargo run --all-features -- contract check --manifest-path new_project/Cargo.toml
- cargo run --all-features -- contract test --manifest-path new_project/Cargo.toml
Expand All @@ -107,17 +117,6 @@ test-new-project-template:
- cargo fmt --verbose --all -- --check
- cargo clippy --verbose --manifest-path Cargo.toml -- -D warnings;

test-dylint:
stage: test
<<: *docker-env
script:
- cd dylint/
- cargo check --verbose
- cargo fmt --verbose --all -- --check
- cargo clippy --verbose -- -D warnings;
- cargo test --verbose --workspace --all-features


#### stage: build (default features)

build:
Expand Down
Loading

0 comments on commit e76bce7

Please sign in to comment.