Skip to content

Commit

Permalink
Fix test coverage for acala (#1590)
Browse files Browse the repository at this point in the history
* Re-enabled test coverage script

* first attempt to fix the script

* added script to install clang-dev

* use wget to install clang-dev

* add dependency install using apt

* no message

* Fixed a sudo typo

* Exported libclang path

* no message

* removed sudo

* no message

* Fixed yml

* no message

* no message

* changed llvm version

* Added a timeout so the job deosn't quite early

* Updated to codecov-action v2

* Fixed a broken yml

* improved the script a bit

* removed --verbose to save IO space

* changed to runs-on to use our self-hosted machine

* Added verbose back to easier debugging

* Set cache size to 50G

* Increased sccache size to 100g

* Added a little debugging command

* no message

* no message

* Removed tarpaulin image, install it via cargo manually

* no message

* no message

* no message

* reverted cleanup action

* Added sudo

* re-exported libclang path

* Updated to correct llvm version

* Changed manual run to use actions-rs

* Updated how variables are defined in actions-rs/tarpaulin@v0.1

* changed variable use from single {} to double {{}}

* use the actual string instead of variable

* added --verbose to see if we can get more info about the build failure

* Fixed a wrong flag

* Downgraded tarpaulin version to 0.18.0

* try skipping runtime-integraion-tests package

* Added --workspace tag

* Added a patch for bindgen

* exclude runtime integration test to better expose the package that's failing

* Fixed broken cargo command

* fixed -exclude to --exclude

* Fixed a typo triple ---

* Try to undefine security option

* excluding runtimes for now

* removed security-opt

* Added command to disable ASLR

* no message

* no message

* Improved exclude package list

* Fixed a space type

* Removed the with-mandala-runtime feature

* Removed the redundant yml

Co-authored-by: Roy Yang <roy@laminar.one>
  • Loading branch information
syan095 and Roy Yang authored Jan 7, 2022
1 parent b8e0d02 commit 84bd208
Showing 1 changed file with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,21 @@ on:
- '**/README.md'

env:
TARPAULIN_VERSION: 0.18.2

TARPAULIN_VERSION: 0.18.5
LIBCLANG_PATH: "/usr/lib/llvm-10/lib"
SCCACHE_CACHE_SIZE: "100G"
CARGO_INCREMENTAL: 0
jobs:
test:
name: Coverage Report
runs-on: ubuntu-latest
runs-on: ubuntu-latest #[self-hosted, linux]
steps:
- name: Cancel Previous Runs
# Only cancel non-master branch runs
if: ${{ github.ref != 'refs/heads/master' }}
uses: styfle/cancel-workflow-action@0.9.0
with:
access_token: ${{ github.token }}
- name: Clean
run: |
df -h
curl -s https://raw.githubusercontent.com/apache/flink/master/tools/azure-pipelines/free_disk_space.sh | bash
- name: Checkout repository
uses: actions/checkout@v2
with:
Expand All @@ -43,14 +41,19 @@ jobs:
components: rustfmt
target: wasm32-unknown-unknown
default: true
- name: Generate code coverage
- name: Install additional dependencies
run: |
wget https://github.com/xd009642/tarpaulin/releases/download/${{ env.TARPAULIN_VERSION }}/cargo-tarpaulin-${{ env.TARPAULIN_VERSION }}-travis.tar.gz
tar -zxvf cargo-tarpaulin-${{ env.TARPAULIN_VERSION }}-travis.tar.gz -C $HOME/.cargo/bin
# TODO: remove `--avoid-cfg-tarpaulin` after https://github.com/xd009642/tarpaulin/issues/756
cargo tarpaulin --avoid-cfg-tarpaulin --debug --verbose --features with-mandala-runtime --no-fail-fast --workspace --timeout 300 --out Xml
sudo apt update -y &&
sudo apt install -y cmake pkg-config libssl-dev git gcc build-essential git clang libclang-dev
- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
version: ${{ env.TARPAULIN_VERSION }}
timeout: 900
out-type: Xml
args: '--avoid-cfg-tarpaulin --no-fail-fast --workspace -e acala-inspect acala acala-cli e2e-tests acala-service acala-primitives acala-rpc acala-runtime runtime-common runtime-integration-tests karura-runtime mandala-runtime'
- name: Upload to codecov.io
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v2
with:
# token: ${{secrets.CODECOV_TOKEN}} # not required for public repos
fail_ci_if_error: true
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)

0 comments on commit 84bd208

Please sign in to comment.