Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
name: Run unit tests
name: Test & Build

on:
push:
branches: [master]
paths:
- 'pnpm-lock.yaml'
- 'packages/**'
- '.github/workflows/TestAndBuild.yml'
pull_request:
branches: [master]
paths:
- 'pnpm-lock.yaml'
- 'packages/**'
- '.github/workflows/TestAndBuild.yml'

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
Expand Down Expand Up @@ -55,3 +56,27 @@ jobs:
if [[ $failures -gt 0 ]]; then
exit 1;
fi

- name: "Build packages"
run: pnpm -r pack

- name: "Prepare artifacts"
id: 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
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: ${{ steps.prepare-artifacts.outputs.PACKAGES_NAME }}
path: artifacts/*.tgz
retention-days: 5

Loading