From a662e83227e98cdf9c38d2d3850135a79424dd64 Mon Sep 17 00:00:00 2001 From: Arjo Bruijnes Date: Wed, 8 Jul 2026 10:42:59 +0200 Subject: [PATCH 1/3] Build and archive packages for testing --- .../{UnitTests.yml => TestAndBuild.yml} | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) rename .github/workflows/{UnitTests.yml => TestAndBuild.yml} (66%) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/TestAndBuild.yml similarity index 66% rename from .github/workflows/UnitTests.yml rename to .github/workflows/TestAndBuild.yml index 95c85000..1115f895 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/TestAndBuild.yml @@ -1,4 +1,4 @@ -name: Run unit tests +name: Test & Build on: push: @@ -13,10 +13,9 @@ on: - 'packages/**' jobs: - test: - name: "Unit tests" + test-build: + name: "Quality Checks & Build" runs-on: ubuntu-latest - steps: - name: "Checking-out code" uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2 @@ -55,3 +54,22 @@ jobs: if [[ $failures -gt 0 ]]; then exit 1; fi + + - name: "Build packages" + run: pnpm -r pack + + - name: "Prepare artifacts" + run: | + mkdir artifacts + sha_short=$(echo "$GITHUB_SHA" | head -c 7) + for package in $(ls *.tgz); do + revisioned=$(echo "$package" | sed -e "s/^\(.*\)\(.tgz\)/\1-$sha_short\2/") + mv $package ./artifacts/$revisioned + done + + - name: "Archive artifacts" + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: packages + path: artifacts/*.tgz + retention-days: 5 From 9d84caee12319007443cb6a5960ed48e850b6f66 Mon Sep 17 00:00:00 2001 From: Arjo Bruijnes Date: Fri, 31 Jul 2026 13:42:50 +0200 Subject: [PATCH 2/3] Make artifact archive name unique per run --- .github/workflows/TestAndBuild.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/TestAndBuild.yml b/.github/workflows/TestAndBuild.yml index 1115f895..b0decffe 100644 --- a/.github/workflows/TestAndBuild.yml +++ b/.github/workflows/TestAndBuild.yml @@ -59,6 +59,7 @@ jobs: run: pnpm -r pack - name: "Prepare artifacts" + id: prepare-artifacts run: | mkdir artifacts sha_short=$(echo "$GITHUB_SHA" | head -c 7) @@ -66,10 +67,14 @@ jobs: revisioned=$(echo "$package" | sed -e "s/^\(.*\)\(.tgz\)/\1-$sha_short\2/") mv $package ./artifacts/$revisioned done + SAFE_GIT_REF="$(echo '${{github.ref_name}}' | sed -e 's/^\(.*\)\/merge$/pr\1/' -e 's/\//__/g')" + printf 'PACKAGES_NAME=widgets-tools.%s.%s' "$SAFE_GIT_REF" "${{ github.run_number }}" >> "$GITHUB_OUTPUT" - name: "Archive artifacts" uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + id: archive-artifacts with: - name: packages + name: ${{ steps.prepare-artifacts.outputs.PACKAGES_NAME }} path: artifacts/*.tgz retention-days: 5 + From 3fcbd140754d221c10b31c330e200dfb4f985730 Mon Sep 17 00:00:00 2001 From: Arjo Bruijnes Date: Mon, 3 Aug 2026 10:46:40 +0200 Subject: [PATCH 3/3] Add workflow file as trigger --- .github/workflows/TestAndBuild.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/TestAndBuild.yml b/.github/workflows/TestAndBuild.yml index b0decffe..a90d8fe7 100644 --- a/.github/workflows/TestAndBuild.yml +++ b/.github/workflows/TestAndBuild.yml @@ -6,11 +6,13 @@ on: paths: - 'pnpm-lock.yaml' - 'packages/**' + - '.github/workflows/TestAndBuild.yml' pull_request: branches: [master] paths: - 'pnpm-lock.yaml' - 'packages/**' + - '.github/workflows/TestAndBuild.yml' jobs: test-build: