ci: run Forgejo Actions & Packages test w/ dynamic matrix (#1367)
Incorporates these changes: - When `forgejo/build-from-sources` is present, Actions & Packages tests are run only against the built versions. Otherwise, they are run against the versions defined in `$RELEASE_NUMBERS` - Updates Packages tests which are testing Alpine publishing to use currently supported Alpine releases - Actions & Packages tests are run in a matrix, allowing parallel execution Only the Actions & Packages tests take a significant amount of time (>10 minutes), so changes have been limited to those test suites -- every test suite that is moved into a matrix adds additional overhead in the 1 minute `prepare-end-to-end` step. Reviewed-on: https://code.forgejo.org/forgejo/end-to-end/pulls/1367 Co-authored-by: Mathieu Fenniak <mathieu@fenniak.net> Co-committed-by: Mathieu Fenniak <mathieu@fenniak.net>
This commit is contained in:
parent
6e89c972c3
commit
1064337c89
13 changed files with 24 additions and 7 deletions
|
|
@ -18,6 +18,7 @@ jobs:
|
|||
image: 'data.forgejo.org/oci/node:20-bookworm'
|
||||
outputs:
|
||||
built: "${{ steps.build.outputs.built }}"
|
||||
forgejo_versions_json: "${{ steps.build.outputs.forgejo_versions_json }}"
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
- uses: https://data.forgejo.org/actions/setup-go@v5
|
||||
|
|
@ -31,6 +32,8 @@ jobs:
|
|||
|
||||
if ! test -f forgejo/build-from-sources; then
|
||||
echo forgejo/build-from-sources is not present, do not build any version from source
|
||||
source lib/lib.sh
|
||||
echo "forgejo_versions_json=$(node -p "JSON.stringify(process.argv[1].split(' '))" "$RELEASE_NUMBERS")" >> $FORGEJO_OUTPUT
|
||||
echo "built=no" >> $FORGEJO_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
|
@ -52,6 +55,7 @@ jobs:
|
|||
mv $forgejo /tmp/forgejo-upload/forgejo-$version
|
||||
done
|
||||
|
||||
echo "forgejo_versions_json=$(node -p "JSON.stringify(process.argv[1].split(' '))" "$(cat forgejo/build-from-sources)")" >> $FORGEJO_OUTPUT
|
||||
echo "built=yes" >> $FORGEJO_OUTPUT
|
||||
|
||||
- name: steps context dump for debug
|
||||
|
|
@ -70,12 +74,15 @@ jobs:
|
|||
packages:
|
||||
needs: [build]
|
||||
runs-on: lxc-trixie
|
||||
strategy:
|
||||
matrix:
|
||||
forgejo_version: ${{ fromJSON(needs.build.outputs.forgejo_versions_json) }}
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
- uses: ./.forgejo/prepare-end-to-end
|
||||
with:
|
||||
built: ${{ needs.build.outputs.built }}
|
||||
- run: su forgejo -c "./end-to-end.sh test_packages"
|
||||
- run: su forgejo -c "./end-to-end.sh test_packages ${{ matrix.forgejo_version }}"
|
||||
- if: ${{ needs.build.outputs.built == 'yes' }}
|
||||
uses: ./.forgejo/upload-coverage
|
||||
with:
|
||||
|
|
@ -87,13 +94,16 @@ jobs:
|
|||
actions:
|
||||
needs: [build]
|
||||
runs-on: lxc-trixie
|
||||
strategy:
|
||||
matrix:
|
||||
forgejo_version: ${{ fromJSON(needs.build.outputs.forgejo_versions_json) }}
|
||||
steps:
|
||||
- uses: https://data.forgejo.org/actions/checkout@v4
|
||||
- uses: ./.forgejo/prepare-end-to-end
|
||||
with:
|
||||
built: ${{ needs.build.outputs.built }}
|
||||
- run: ./end-to-end.sh prepare_dockerd
|
||||
- run: su forgejo -c "./end-to-end.sh test_actions"
|
||||
- run: su forgejo -c "./end-to-end.sh test_actions ${{ matrix.forgejo_version }}"
|
||||
- if: ${{ needs.build.outputs.built == 'yes' }}
|
||||
uses: ./.forgejo/upload-coverage
|
||||
with:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue