mirror of
https://github.com/GTNewHorizons/GTNH-Actions-Workflows.git
synced 2026-05-30 22:09:55 +02:00
Fix Multiple Test Appearance (#63)
This commit is contained in:
parent
57b9aaba93
commit
6c377742ea
109
.github/workflows/build-and-test.yml
vendored
109
.github/workflows/build-and-test.yml
vendored
@ -34,10 +34,6 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
build-and-test:
|
build-and-test:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
outputs:
|
|
||||||
jar_matrix: ${{ steps.expose-jars.outputs.matrix }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install Ubuntu dependencies
|
- name: Install Ubuntu dependencies
|
||||||
run: |
|
run: |
|
||||||
@ -183,19 +179,98 @@ jobs:
|
|||||||
path: build/libs/
|
path: build/libs/
|
||||||
retention-days: 90
|
retention-days: 90
|
||||||
|
|
||||||
- name: Store the name of each built file
|
- name: Find individual compilation artifacts
|
||||||
id: expose-jars
|
id: find-artifacts
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
shopt -s nullglob
|
mapfile -t files < <(find build/libs -maxdepth 1 -type f | sort)
|
||||||
JAR_JSON=$(jq -n -c '$ARGS.positional' --args build/libs/*.jar)
|
|
||||||
echo "matrix=$JAR_JSON" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
run-individual-uploads:
|
if (( ${#files[@]} > 10 )); then
|
||||||
needs: build-and-test
|
echo "::warning::Found ${#files[@]} files in build/libs, but only the first 10 will be uploaded individually."
|
||||||
strategy:
|
fi
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
for i in {0..9}; do
|
||||||
jar: ${{ fromJson(needs.build-and-test.outputs.jar_matrix) }}
|
if [[ -n "${files[$i]:-}" ]]; then
|
||||||
uses: ./.github/workflows/upload-individual-jar.yml
|
echo "file_${i}=${files[$i]}" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Upload individual compilation artifact 1
|
||||||
|
if: ${{ steps.find-artifacts.outputs.file_0 != '' }}
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
jar_path: ${{ matrix.jar }}
|
path: ${{ steps.find-artifacts.outputs.file_0 }}
|
||||||
|
retention-days: 90
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload individual compilation artifact 2
|
||||||
|
if: ${{ steps.find-artifacts.outputs.file_1 != '' }}
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: ${{ steps.find-artifacts.outputs.file_1 }}
|
||||||
|
retention-days: 90
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload individual compilation artifact 3
|
||||||
|
if: ${{ steps.find-artifacts.outputs.file_2 != '' }}
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: ${{ steps.find-artifacts.outputs.file_2 }}
|
||||||
|
retention-days: 90
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload individual compilation artifact 4
|
||||||
|
if: ${{ steps.find-artifacts.outputs.file_3 != '' }}
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: ${{ steps.find-artifacts.outputs.file_3 }}
|
||||||
|
retention-days: 90
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload individual compilation artifact 5
|
||||||
|
if: ${{ steps.find-artifacts.outputs.file_4 != '' }}
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: ${{ steps.find-artifacts.outputs.file_4 }}
|
||||||
|
retention-days: 90
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload individual compilation artifact 6
|
||||||
|
if: ${{ steps.find-artifacts.outputs.file_5 != '' }}
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: ${{ steps.find-artifacts.outputs.file_5 }}
|
||||||
|
retention-days: 90
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload individual compilation artifact 7
|
||||||
|
if: ${{ steps.find-artifacts.outputs.file_6 != '' }}
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: ${{ steps.find-artifacts.outputs.file_6 }}
|
||||||
|
retention-days: 90
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload individual compilation artifact 8
|
||||||
|
if: ${{ steps.find-artifacts.outputs.file_7 != '' }}
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: ${{ steps.find-artifacts.outputs.file_7 }}
|
||||||
|
retention-days: 90
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload individual compilation artifact 9
|
||||||
|
if: ${{ steps.find-artifacts.outputs.file_8 != '' }}
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: ${{ steps.find-artifacts.outputs.file_8 }}
|
||||||
|
retention-days: 90
|
||||||
|
archive: false
|
||||||
|
|
||||||
|
- name: Upload individual compilation artifact 10
|
||||||
|
if: ${{ steps.find-artifacts.outputs.file_9 != '' }}
|
||||||
|
uses: actions/upload-artifact@v7
|
||||||
|
with:
|
||||||
|
path: ${{ steps.find-artifacts.outputs.file_9 }}
|
||||||
|
retention-days: 90
|
||||||
|
archive: false
|
||||||
|
|||||||
28
.github/workflows/upload-individual-jar.yml
vendored
28
.github/workflows/upload-individual-jar.yml
vendored
@ -1,28 +0,0 @@
|
|||||||
name: Upload individual JAR
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
jar_path:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
upload-individual-jar:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
# In order to run this for all jars, we have to call it individually for each jar, on a separate job.
|
|
||||||
# Because dynamically running this workflow file requires a unique job run, we can't just grab the jars directly because they're already gone by then.
|
|
||||||
# We have to do this because unzipped upload can only be ran on one file (arbitrary restrictions 💢)
|
|
||||||
- name: Extract archive to retrieve artifact
|
|
||||||
uses: actions/download-artifact@v8
|
|
||||||
with:
|
|
||||||
name: ${{ github.repository_id }}-build-libs
|
|
||||||
path: build/libs
|
|
||||||
|
|
||||||
- name: Upload individual compilation artifact
|
|
||||||
uses: actions/upload-artifact@v7
|
|
||||||
with:
|
|
||||||
path: ${{ inputs.jar_path }}
|
|
||||||
retention-days: 90
|
|
||||||
archive: false
|
|
||||||
Loading…
x
Reference in New Issue
Block a user