Skip to content

Connect CLI to package and repository actions (#18) #35

Connect CLI to package and repository actions (#18)

Connect CLI to package and repository actions (#18) #35

name: πŸ”Ž Code Test Coverage
on:
push:
paths:
- '.github/workflows/code_test_coverage.yml' # Run when this workflow changes
- '**/src/**'
branches: [main]
pull_request:
paths:
- '.github/workflows/code_test_coverage.yml' # Run when this workflow changes
- '**/src/**'
branches: [main]
workflow_dispatch: # Run when manually triggered
workflow_call: # Run when called by another workflow
jobs:
coverage_job:
name: πŸ”Ž Code Test Coverage Job
strategy:
fail-fast: true
matrix:
platform:
- linux
# - windows
# - apple
cpu_architecture: [x86_64]
include:
- platform: linux
cicd_runner: ubuntu-latest
# - platform: windows
# cicd_runner: windows-latest
# - platform: apple
# cicd_runner: macos-latest
- compilation_target: x86_64-unknown-linux-gnu
cpu_architecture: x86_64
platform: linux
toolchain: gnu
# - compilation_target: x86_64-pc-windows-msvc
# cpu_architecture: x86_64
# platform: windows
# toolchain: msvc
# - compilation_target: x86_64-apple-darwin
# cpu_architecture: x86_64
# platform: apple
# toolchain: darwin
runs-on: ${{ matrix.cicd_runner }}
if: |
!startsWith(github.event.head_commit.message, 'style:')
&& !startsWith(github.event.head_commit.message, 'style(')
&& !startsWith(github.event.head_commit.message, 'chore:')
&& !startsWith(github.event.head_commit.message, 'chore(')
steps:
- name: ↕️ Install Ubuntu Dependencies Step
id: dependencies_install_step
if: ${{ matrix.compilation_target == 'x86_64-unknown-linux-gnu' }}
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: libgtk-4-dev
version: 1.0
- name: πŸ”Ž Generate Code Coverage Step
id: coverage_generation_step
uses: pax-hub/rust-github-action@main
env:
RUSTDOCFLAGS: "--enable-index-page -Zunstable-options"
with:
subcommand: llvm-cov
arguments: '--all-features --workspace --lcov --output-path lcov.info'
rust_release_channel: nightly
use_cross: false
compilation_target: ${{ matrix.compilation_target }}
- name: πŸ“Š Upload coverage to Codecov Step
id: coverage_upload_step
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true