From 84c01f064fd96748aaae329877eef5a542094645 Mon Sep 17 00:00:00 2001 From: Sylvie <35663410+Rangi42@users.noreply.github.com> Date: Sat, 21 Sep 2024 11:12:09 -0400 Subject: [PATCH] Refactor some workflows for consistency (#1510) --- .github/workflows/build-container.yml | 3 +- .github/workflows/checkdiff.yml | 2 +- .../workflows/create-release-artifacts.yml | 26 +++++++----- .github/workflows/create-release-docs.yml | 4 +- .github/workflows/testing.yml | 40 +++++++++++-------- .github/workflows/update-master-docs.yml | 4 +- 6 files changed, 46 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index e722f09a..df54b537 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -9,7 +9,8 @@ jobs: if: github.repository_owner == 'gbdev' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: diff --git a/.github/workflows/checkdiff.yml b/.github/workflows/checkdiff.yml index d8a1d44e..feb45061 100644 --- a/.github/workflows/checkdiff.yml +++ b/.github/workflows/checkdiff.yml @@ -1,4 +1,4 @@ -name: "Code coverage checking" +name: Code coverage checking on: pull_request jobs: diff --git a/.github/workflows/create-release-artifacts.yml b/.github/workflows/create-release-artifacts.yml index 2767943a..d54bc564 100644 --- a/.github/workflows/create-release-artifacts.yml +++ b/.github/workflows/create-release-artifacts.yml @@ -1,4 +1,4 @@ -name: "Create release artifacts" +name: Create release artifacts on: push: tags: @@ -24,30 +24,32 @@ jobs: run: | # Turn "vX.Y.Z" into "X.Y.Z" VERSION="${{ github.ref_name }}" echo "version=${VERSION#v}" >> $GITHUB_ENV - - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - name: Install deps run: .github/scripts/get_win_deps.ps1 - - uses: actions/cache@v4 + - name: Check libraries cache id: cache + uses: actions/cache@v4 with: path: | zbuild pngbuild key: ${{ matrix.arch }}-${{ hashFiles('zlib/**', 'libpng/**') }} - name: Build zlib + if: steps.cache.outputs.cache-hit != 'true' run: | # BUILD_SHARED_LIBS causes the output DLL to be correctly called `zlib1.dll` cmake -S zlib -B zbuild -A ${{ matrix.platform }} -Wno-dev -DCMAKE_INSTALL_PREFIX=install_dir -DBUILD_SHARED_LIBS=ON cmake --build zbuild --config Release -j - if: steps.cache.outputs.cache-hit != 'true' - name: Install zlib run: | cmake --install zbuild - name: Build libpng + if: steps.cache.outputs.cache-hit != 'true' shell: bash run: | cmake -S libpng -B pngbuild -A ${{ matrix.platform }} -Wno-dev -DCMAKE_INSTALL_PREFIX=install_dir -DPNG_SHARED=ON -DPNG_STATIC=OFF -DPNG_TESTS=OFF cmake --build pngbuild --config Release -j - if: steps.cache.outputs.cache-hit != 'true' - name: Install libpng run: | cmake --install pngbuild @@ -74,7 +76,8 @@ jobs: run: | # Turn "refs/tags/vX.Y.Z" into "X.Y.Z" VERSION="${{ github.ref_name }}" echo "version=${VERSION#v}" >> $GITHUB_ENV - - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - name: Install deps shell: bash run: | @@ -104,7 +107,8 @@ jobs: run: | # Turn "refs/tags/vX.Y.Z" into "X.Y.Z" VERSION="${{ github.ref_name }}" echo "version=${VERSION#v}" >> $GITHUB_ENV - - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - name: Install deps shell: bash run: | @@ -133,17 +137,19 @@ jobs: run: | # Turn "refs/tags/vX.Y.Z" into "X.Y.Z" VERSION="${{ github.ref_name }}" echo "version=${VERSION#v}" >> $GITHUB_ENV - - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - name: Package sources run: | make dist Q= ls - - uses: actions/download-artifact@v4 + - name: Download Linux binaries + uses: actions/download-artifact@v4 - name: Release uses: softprops/action-gh-release@v2 with: body: | - Please ensure that the four packages below work properly. + Please ensure that the packages below work properly. Once that's done, replace this text with the changelog, un-draft the release, and update the `release` branch. By the way, if you forgot to update `include/version.hpp`, RGBASM's version test is gonna fail in the tag's regression testing! (Use `git push --delete origin ` to delete it) draft: true # Don't publish the release quite yet... diff --git a/.github/workflows/create-release-docs.yml b/.github/workflows/create-release-docs.yml index f69ae7ac..7a71603d 100644 --- a/.github/workflows/create-release-docs.yml +++ b/.github/workflows/create-release-docs.yml @@ -1,4 +1,4 @@ -name: "Create release docs" +name: Create release docs on: release: types: @@ -7,7 +7,7 @@ on: jobs: build: if: github.repository_owner == 'gbdev' - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout rgbds@release uses: actions/checkout@v4 diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index e9900767..b3fe0f01 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -1,4 +1,4 @@ -name: "Regression testing" +name: Regression testing on: - push - pull_request @@ -17,7 +17,8 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - name: Install deps shell: bash run: | @@ -58,8 +59,8 @@ jobs: with: path: ${{ fromJSON(steps.test-deps-cache-params.outputs.paths) }} key: ${{ matrix.os }}-${{ steps.test-deps-cache-params.outputs.hash }} - - if: steps.test-deps-cache.outputs.cache-hit != 'true' - name: Fetch test dependency repositories + - name: Fetch test dependency repositories + if: steps.test-deps-cache.outputs.cache-hit != 'true' continue-on-error: true run: | test/fetch-test-deps.sh @@ -75,7 +76,8 @@ jobs: macos-static: runs-on: macos-14 steps: - - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - name: Install deps shell: bash run: | @@ -109,8 +111,8 @@ jobs: with: path: ${{ fromJSON(steps.test-deps-cache-params.outputs.paths) }} key: ${{ matrix.os }}-${{ steps.test-deps-cache-params.outputs.hash }} - - if: steps.test-deps-cache.outputs.cache-hit != 'true' - name: Fetch test dependency repositories + - name: Fetch test dependency repositories + if: steps.test-deps-cache.outputs.cache-hit != 'true' continue-on-error: true run: | test/fetch-test-deps.sh @@ -138,30 +140,32 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - name: Install deps run: .github/scripts/get_win_deps.ps1 - - uses: actions/cache@v4 + - name: Check libraries cache id: cache + uses: actions/cache@v4 with: path: | zbuild pngbuild key: ${{ matrix.arch }}-${{ hashFiles('zlib/**', 'libpng/**') }} - name: Build zlib + if: steps.cache.outputs.cache-hit != 'true' run: | # BUILD_SHARED_LIBS causes the output DLL to be correctly called `zlib1.dll` cmake -S zlib -B zbuild -A ${{ matrix.platform }} -Wno-dev -DCMAKE_INSTALL_PREFIX=install_dir -DBUILD_SHARED_LIBS=ON cmake --build zbuild --config Release -j - if: steps.cache.outputs.cache-hit != 'true' - name: Install zlib run: | cmake --install zbuild - name: Build libpng + if: steps.cache.outputs.cache-hit != 'true' shell: bash run: | cmake -S libpng -B pngbuild -A ${{ matrix.platform }} -Wno-dev -DCMAKE_INSTALL_PREFIX=install_dir -DPNG_SHARED=ON -DPNG_STATIC=OFF -DPNG_TESTS=OFF cmake --build pngbuild --config Release -j - if: steps.cache.outputs.cache-hit != 'true' - name: Install libpng run: | cmake --install pngbuild @@ -196,8 +200,8 @@ jobs: with: path: ${{ fromJSON(steps.test-deps-cache-params.outputs.paths) }} key: ${{ matrix.os }}-${{ matrix.bits }}-${{ steps.test-deps-cache-params.outputs.hash }} - - if: steps.test-deps-cache.outputs.cache-hit != 'true' - name: Fetch test dependency repositories + - name: Fetch test dependency repositories + if: steps.test-deps-cache.outputs.cache-hit != 'true' shell: bash continue-on-error: true run: | @@ -229,7 +233,8 @@ jobs: env: DIST_DIR: win${{ matrix.bits }} steps: - - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - name: Install deps shell: bash run: | @@ -273,7 +278,8 @@ jobs: fail-fast: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout repo + uses: actions/checkout@v4 - name: Retrieve binaries uses: actions/download-artifact@v4 with: @@ -303,8 +309,8 @@ jobs: with: path: ${{ fromJSON(steps.test-deps-cache-params.outputs.paths) }} key: mingw-${{ matrix.bits }}-${{ steps.test-deps-cache-params.outputs.hash }} - - if: steps.test-deps-cache.outputs.cache-hit != 'true' - name: Fetch test dependency repositories + - name: Fetch test dependency repositories + if: steps.test-deps-cache.outputs.cache-hit != 'true' shell: bash continue-on-error: true run: | diff --git a/.github/workflows/update-master-docs.yml b/.github/workflows/update-master-docs.yml index 7a24c072..26391b8e 100644 --- a/.github/workflows/update-master-docs.yml +++ b/.github/workflows/update-master-docs.yml @@ -1,4 +1,4 @@ -name: "Update master docs" +name: Update master docs on: push: branches: @@ -17,7 +17,7 @@ on: jobs: build: if: github.repository_owner == 'gbdev' - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout rgbds@master uses: actions/checkout@v4