From c03082b8df88e08d88818d65d025c07e17e98a35 Mon Sep 17 00:00:00 2001 From: mulhern Date: Thu, 13 Aug 2026 11:17:43 -0400 Subject: [PATCH] Make a reusable workflow for running tools that work generally The configuration of these tools is done by configuration files and identically named Makefile targets in the individual repos. The Rust check, of which there is only typos so far, are always built with the stable toolchain, regardless of what is specified in any toolchain file that may be in the repo being tested. This is the sensible course, since the outcome of interest is the result of the test, now how the tool was built. Make workflow configurable by the Fedora release that it runs on, to enable piecemeal updating of individual repos to new Fedora releases. Use the reusable workflow just introduced in main.yml. Signed-off-by: mulhern --- .github/workflows/main.yml | 30 +++--------------------- .github/workflows/reusable_general.yml | 32 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/reusable_general.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1359463..0fb762e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,30 +13,6 @@ on: jobs: checks: - runs-on: ubuntu-24.04 - container: - image: fedora:43 # CURRENT DEVELOPMENT ENVIRONMENT - steps: - - name: Install dependencies for Fedora - run: dnf install -y make yamllint - - uses: actions/checkout@v4 - - name: Run yamllint check - run: make yamllint - - rust_dependent_checks: - runs-on: ubuntu-latest - container: fedora:43 # CURRENT DEVELOPMENT ENVIRONMENT - steps: - - uses: actions/checkout@v6 - with: - persist-credentials: false - - name: Install dependencies - run: dnf install -y clang curl make - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: cargo - - uses: baptiste0928/cargo-install@v3 - with: - crate: typos-cli - - name: Run test - run: make -f Makefile check-typos + uses: $/.github/workflows/reusable_general.yml + with: + fedora-container-image-number: 43 # CURRENT DEVELOPMENT ENVIRONMENT diff --git a/.github/workflows/reusable_general.yml b/.github/workflows/reusable_general.yml new file mode 100644 index 0000000..741c3f6 --- /dev/null +++ b/.github/workflows/reusable_general.yml @@ -0,0 +1,32 @@ +--- +name: Reusable Checks that are repo-language agnostic + +on: + workflow_call: + inputs: + fedora-container-image-number: + description: "Fedora Container Image Number" + required: true + type: number + +jobs: + general_checks: + runs-on: ubuntu-latest + container: fedora:${{ inputs.fedora-container-image-number }} + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + - name: Install dependencies + run: dnf install -y clang curl make yamllint + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: cargo + toolchain: stable + - uses: baptiste0928/cargo-install@v3 + with: + crate: typos-cli + - name: Run typos check + run: make -f Makefile check-typos + - name: Run yamllint check + run: make -f Makefile yamllint