From 5cd8441fc36a6ccbbe005585491deea37caed056 Mon Sep 17 00:00:00 2001 From: Lucas Steuernagel Date: Tue, 26 Sep 2023 14:28:48 -0300 Subject: [PATCH] Upload artifacts Signed-off-by: Lucas Steuernagel --- .github/workflows/test.yml | 85 +++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 33 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f0b16240..b022899e5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,8 +52,15 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive - - name: Rust stable - run: rustup default 1.70.0 + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + components: | + llvm-tools + clippy + rustfmt + - name: cargo install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov - name: Run cargo clippy run: cargo clippy --workspace --tests --bins -- -D warnings - name: Run cargo clippy without wasm_opt feature @@ -64,16 +71,28 @@ jobs: run: cargo doc --workspace --bins - name: Run cargo fmt run: cargo fmt --all -- --check - - name: Build - if: always() - run: cargo build --verbose - - name: Run tests - if: always() - run: cargo test --verbose --workspace - - uses: actions/upload-artifact@v3.1.0 + - name: Configure llvm-cov and build + run: | + cargo llvm-cov show-env --export-prefix > env.sh + source env.sh + cargo llvm-cov build + echo $LLVM_PROFILE_FILE + - name: Upload binary + uses: actions/upload-artifact@v3.1.0 with: name: solang-linux-x86-64 path: ./target/debug/solang + - name: Run tests + if: always() + run: cargo llvm-cov --all-features --workspace --no-report + - name: Compress test coverage files + run: tar -czvf rust-tests.tar.gz *.profraw + working-directory: ./target + - name: Upload test coverage files + uses: actions/upload-artifact@v3.1.0 + with: + name: rust-test + path: ./target/rust-test.tar.gz linux-arm: name: Linux Arm @@ -418,27 +437,27 @@ jobs: ./test working-directory: ./stdlib - coverage: - runs-on: ubuntu-latest - container: ghcr.io/hyperledger/solang-llvm:ci-5 - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: recursive - - name: Install Rust - uses: dtolnay/rust-toolchain@stable - with: - components: llvm-tools - - name: cargo install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - name: cargo llvm-cov - run: cargo llvm-cov --all-features --lcov --output-path lcov.info - env: - CARGO_HUSKY_DONT_INSTALL_HOOKS: true - - name: Upload coverage report to codecov.io - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - fail_ci_if_error: true +# coverage: +# runs-on: ubuntu-latest +# container: ghcr.io/hyperledger/solang-llvm:ci-5 +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# with: +# submodules: recursive +# - name: Install Rust +# uses: dtolnay/rust-toolchain@stable +# with: +# components: llvm-tools +# - name: cargo install cargo-llvm-cov +# uses: taiki-e/install-action@cargo-llvm-cov +# - name: cargo llvm-cov +# run: cargo llvm-cov --all-features --lcov --output-path lcov.info +# env: +# CARGO_HUSKY_DONT_INSTALL_HOOKS: true +# - name: Upload coverage report to codecov.io +# uses: codecov/codecov-action@v3 +# env: +# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} +# with: +# fail_ci_if_error: true