refactor: ๐ Reorganize package and repository actions into sepaโฆ #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |