Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
pvshvp-oss committed Mar 14, 2024
1 parent dbe6bd4 commit 161341b
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 151 deletions.
42 changes: 14 additions & 28 deletions .github/workflows/api_documentation.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: πŸ“œ API Documentation Workflow

on:
push:
paths:
Expand All @@ -7,8 +9,6 @@ on:
workflow_dispatch: # Run when manually triggered
workflow_call: # Run when called by another workflow

name: πŸ“œ API Documentation Workflow

jobs:
build_documentation_job:
name: πŸ›  Build Documentation Job
Expand All @@ -31,46 +31,32 @@ jobs:
toolchain: gnu
runs-on: ${{ matrix.cicd_runner }}
steps:
- name: 🎟 Checkout Git Repository Step
id: repository_checkout_step
uses: actions/checkout@v4
- name: ↕️ Install Ubuntu Dependencies Step
id: dependencies_install_step
if: ${{ matrix.cicd_runner == 'ubuntu-latest' }}
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: 🧰 Install Rust Toolchain Step
id: toolchain_install_step
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
targets: ${{ matrix.compilation_target }}
components: rustc, cargo
- name: πŸ”„ Install Cross-Compilation Tools Step
id: cross_install_step
if: ${{ matrix.cpu_architecture != 'x86_64' }}
uses: taiki-e/setup-cross-toolchain-action@v1
with:
targets: ${{ matrix.compilation_target }}
- name: πŸ—‚ Setup Cache Step
id: cache_setup_step
uses: Swatinem/rust-cache@v2
- name: πŸ“œ Cargo Doc Step
id: cargo_doc_step
- name: πŸ“œ Build Documentation Step
id: documentation_build_step
uses: pax-hub/rust-github-action@main
env:
RUSTDOCFLAGS: "--enable-index-page -Zunstable-options"
run: |
cargo doc --all-features --workspace --no-deps --document-private-items
- name: ⬆ Upload Docs Artifact Step
with:
subcommand: doc
arguments: '--all-features --workspace --no-deps --document-private-items'
rust_release_channel: nightly
use_cross: false
compilation_target: ${{ matrix.compilation_target }}
- name: ⬆ Upload Documentation Step
id: documentation_upload_step
uses: actions/upload-pages-artifact@v3
with:
path: target/doc
publish_documentation_job:
name: ✈ Publish Documentation Job
if: github.ref == 'refs/heads/main'
if: github.ref == 'refs/heads/main' # Publish only while dealing with the main branch
needs: build_documentation_job
runs-on: ubuntu-latest
permissions:
Expand Down
33 changes: 11 additions & 22 deletions .github/workflows/code_test_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: πŸ”Ž Code Test Coverage Workflow

on:
push:
paths:
Expand All @@ -12,8 +14,6 @@ on:
workflow_dispatch: # Run when manually triggered
workflow_call: # Run when called by another workflow

name: πŸ”Ž Code Test Coverage Workflow

jobs:
coverage_job:
name: πŸ”Ž Code Test Coverage Job
Expand Down Expand Up @@ -51,28 +51,17 @@ jobs:
&& !startsWith(github.event.head_commit.message, 'chore:')
&& !startsWith(github.event.head_commit.message, 'chore(')
steps:
- name: 🎟 Checkout Git Repository Step
id: repository_checkout_step
uses: actions/checkout@v4
- name: 🧰 Install Rust Toolchain Step
id: toolchain_install_step
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
targets: ${{ matrix.compilation_target }}
components: rustc, cargo
- name: πŸ”„ Install Cross-Compilation Tools Step
id: cross_install_step
if: ${{ matrix.cpu_architecture != 'x86_64' }}
uses: taiki-e/setup-cross-toolchain-action@v1
with:
targets: ${{ matrix.compilation_target }}
- name: πŸ—‚ Setup Cache Step
id: cache_setup_step
uses: Swatinem/rust-cache@v2
- name: πŸ”Ž Generate Code Coverage Step
id: coverage_generation_step
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
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
Expand Down
86 changes: 30 additions & 56 deletions .github/workflows/code_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ name: βœ” Validate Code Workflow

jobs:
code_validation_job:
name: ${{ matrix.job_name }}
name: ${{ matrix.step_name }}
if: |
!startsWith(github.event.head_commit.message, 'chore:')
&& !startsWith(github.event.head_commit.message, 'chore(')
Expand All @@ -33,7 +33,7 @@ jobs:
cpu_architecture:
- x86_64
- aarch64
task:
subcommand:
- fmt
- clippy
- check
Expand All @@ -50,79 +50,53 @@ jobs:
cicd_runner: windows-latest
- platform: apple
cicd_runner: macos-latest
- command_base: cross
- use_cross: true
- compilation_target: x86_64-unknown-linux-gnu
cpu_architecture: x86_64
platform: linux
toolchain: gnu
command_base: cargo
use_cross: false
- compilation_target: x86_64-pc-windows-msvc
cpu_architecture: x86_64
platform: windows
toolchain: msvc
command_base: cargo
use_cross: false
- compilation_target: x86_64-apple-darwin
cpu_architecture: x86_64
platform: apple
toolchain: darwin
command_base: cargo
use_cross: false
- compilation_target: aarch64-unknown-linux-gnu
cpu_architecture: aarch64
platform: linux
toolchain: gnu
- task: fmt
job_name: πŸ“‘ Cargo Fmt Job
rust_toolchain_components: cargo, rustfmt
- task: clippy
job_name: πŸ“Ž Cargo Clippy Job
rust_toolchain_components: cargo, clippy
- task: check
job_name: βœ… Cargo Check Job
rust_toolchain_components: cargo, rustc, rust-std
- task: test
job_name: πŸ§ͺ Cargo Test Job
rust_toolchain_components: cargo, rustc, rust-std
- subcommand: fmt
step_name: πŸ“‘ Cargo Fmt Job
arguments: '--verbose -- --check'
- subcommand: clippy
step_name: πŸ“Ž Cargo Clippy Job
arguments: '--workspace -- -D warnings'
- subcommand: check
step_name: βœ… Cargo Check Job
arguments: '--workspace'
- subcommand: test
step_name: πŸ§ͺ Cargo Test Job
arguments: '--workspace'
runs-on: ${{ matrix.cicd_runner }}
steps:
- name: 🎟 Checkout Git Repository Step
id: repository_checkout_step
uses: actions/checkout@v4
- name: 🧰 Install Rust Toolchain Step
id: toolchain_install_step
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
targets: ${{ matrix.compilation_target }}
components: ${{ matrix.rust_toolchain_components }}
- name: πŸ”„ Install Cross-Compilation Tools Step
id: cross_install_step
if: ${{ matrix.command_base == 'cross' }}
uses: taiki-e/install-action@v2
with:
tool: cross
- name: πŸ—‚ Setup Cache Step
id: cache_setup_step
uses: Swatinem/rust-cache@v2
- name: ↕️ Install Ubuntu Dependencies Step
id: ubuntu_dependencies_install_step
if: ${{ matrix.cicd_runner == 'ubuntu-latest' && matrix.command_base == 'cargo' }}
id: dependencies_install_step
if: ${{ matrix.compilation_target == 'x86_64-unknown-linux-gnu' }}
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: build-essential libssl-dev libgtk-4-dev
packages: libgtk-4-dev
version: 1.0
- name: πŸ“‘ Fmt Step
id: fmt_step
if: ${{ matrix.task == 'fmt' }}
run: cargo fmt --verbose -- --check
- name: πŸ“Ž Clippy Step
id: clippy_step
if: ${{ matrix.task == 'clippy' }}
run: ${{ matrix.command_base }} clippy --workspace --target ${{ matrix.compilation_target }} -- -D warnings
- name: βœ… Check Step
id: check_step
if: ${{ matrix.task == 'check' }}
run: ${{ matrix.command_base }} check --workspace --target ${{ matrix.compilation_target }}
- name: πŸ§ͺ Test Step
id: cargo_test_step
if: ${{ matrix.task == 'test' }}
run: ${{ matrix.command_base }} test --workspace --target ${{ matrix.compilation_target }}
- name: ${{ matrix.step_name }}
id: task_step
uses: pax-hub/rust-github-action@main
with:
subcommand: ${{ matrix.subcommand }}
arguments: ${{ matrix.arguments }}
rust_release_channel: nightly
use_cross: ${{ matrix.use_cross }}
compilation_target: ${{ matrix.compilation_target }}
29 changes: 0 additions & 29 deletions .github/workflows/rust_workflow.yml

This file was deleted.

24 changes: 8 additions & 16 deletions .github/workflows/security_audit.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: πŸ•΅οΈβ€β™‚οΈ Security Audit Workflow

on:
push:
paths:
Expand All @@ -15,40 +17,30 @@ on:
workflow_dispatch: # Run when manually triggered
workflow_call: # Run when called by another workflow

name: πŸ•΅οΈβ€β™‚οΈ Security Audit Workflow

jobs:
audit_job:
name: πŸ•΅οΈβ€β™‚οΈ Security Audit Job
# Ignore commits that just change the style of the code or just make miscellaneous changes.
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(')
strategy:
fail-fast: false
fail-fast: false # We want all permutations to run because we want to discover all security vulnerabilities
matrix:
platform: [linux, windows, apple]
cpu_architecture: [x86_64]
include:
- platform: linux
cpu_architecture: x86_64
cicd_runner: ubuntu-latest
- platform: windows
cpu_architecture: x86_64
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
cicd_runner: macos-latest
permissions:
contents: read
issues: write
Expand All @@ -57,7 +49,7 @@ jobs:
- name: 🎟 Checkout Git Repository Step
id: repository_checkout_step
uses: actions/checkout@v4
- name: 🐍 Setup Python Step
- name: πŸ’ΏπŸ Setup Python Step
id: python_setup_step
uses: actions/setup-python@v5
with:
Expand Down

0 comments on commit 161341b

Please sign in to comment.