diff --git a/.github/workflows/basic.yml b/.github/workflows/basic.yml index 8ea03c4c..e328ebf3 100644 --- a/.github/workflows/basic.yml +++ b/.github/workflows/basic.yml @@ -12,6 +12,10 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: fmt: @@ -19,7 +23,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@v4 - uses: ./.github/actions/setup - name: Setup SSH @@ -38,7 +42,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@v4 - uses: ./.github/actions/setup - name: Setup SSH diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..189b7612 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,41 @@ +name: Test coverage + +on: + # Triggers the workflow on push or pull request events but only for the main branch + pull_request: + branches: + - main + push: + branches: + - main + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + TARPAULIN_VERSION: 0.27.3 + +jobs: + coverage: + runs-on: ubuntu-22.04 + + steps: + - uses: actions/checkout@v4 + - uses: Swatinem/rust-cache@v4 + - uses: ./.github/actions/setup + + - name: Run cargo-tarpaulin + run: | + wget https://github.com/xd009642/tarpaulin/releases/download/${{ env.TARPAULIN_VERSION }}/cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz + tar -zxvf cargo-tarpaulin-x86_64-unknown-linux-musl.tar.gz -C $HOME/.cargo/bin + cargo tarpaulin --workspace \ + -e regionx-node regionx-runtime \ + --exclude-files **/mock.rs **/weights/* \ + --out xml + + - name: Upload to codecov.io + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/smoke.yml b/.github/workflows/smoke.yml index 6ab0c602..513ce753 100644 --- a/.github/workflows/smoke.yml +++ b/.github/workflows/smoke.yml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e11242d8..248f9ab2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@v4 - uses: ./.github/actions/setup - name: Setup SSH diff --git a/.github/workflows/try_runtime.yml b/.github/workflows/try_runtime.yml index edfecbd2..fb11d513 100644 --- a/.github/workflows/try_runtime.yml +++ b/.github/workflows/try_runtime.yml @@ -9,7 +9,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@v4 - uses: ./.github/actions/setup - name: Setup SSH