|
8 | 8 | workflow_dispatch:
|
9 | 9 |
|
10 | 10 | jobs:
|
| 11 | + select-tests: |
| 12 | + runs-on: ubuntu-22.04 |
| 13 | + concurrency: |
| 14 | + group: ${{ github.workflow }}-select-tests-${{ github.event.number || github.ref }} |
| 15 | + cancel-in-progress: true |
| 16 | + outputs: |
| 17 | + tests: ${{ steps.trick.outputs.tests }} |
| 18 | + steps: |
| 19 | + - name: Trick Renovate |
| 20 | + id: trick |
| 21 | + shell: bash |
| 22 | + run: | |
| 23 | + USES=$(cat <<TRICK_RENOVATE |
| 24 | + - uses: DanySK/Template-for-Gradle-Plugins@cb970302120bb0b6a01ab495695a9f31babb83c7 |
| 25 | + - uses: DanySK/Template-for-Kotlin-Multiplatform-Projects@0.1.22 |
| 26 | + TRICK_RENOVATE |
| 27 | + ) |
| 28 | + export USES="$USES" |
| 29 | + ruby -e 'puts "tests=#{ENV["USES"].lines.map { |line| /^-\s+uses:\s+([^\s]+\/[^\s]+)@(.*)\s*$/.match(line) }.map { |match| [match[1], match[2]] }}"' >> $GITHUB_OUTPUT |
11 | 30 | test:
|
| 31 | + needs: |
| 32 | + - select-tests |
12 | 33 | strategy:
|
13 | 34 | fail-fast: false
|
14 | 35 | matrix:
|
15 | 36 | os: [ windows-2022, macos-12, ubuntu-22.04 ]
|
| 37 | + test: ${{ fromJson(needs.select-tests.outputs.tests) }} |
16 | 38 | runs-on: ${{ matrix.os }}
|
17 | 39 | concurrency:
|
18 |
| - group: ${{ github.workflow }}-build-${{ matrix.os }}-${{ github.event.number || github.ref }} |
| 40 | + group: ${{ github.workflow }}-test-${{ matrix.os }}-${{ matrix.test[0] }}-${{ matrix.test[1] }}-${{ github.event.number || github.ref }} |
19 | 41 | cancel-in-progress: true
|
20 | 42 | steps:
|
21 | 43 | - name: Checkout
|
22 |
| - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 44 | + uses: actions/checkout@v4.1.1 |
23 | 45 | with:
|
24 | 46 | path: 'action'
|
25 |
| - - name: Trick Renovate |
26 |
| - id: trick |
27 |
| - shell: bash |
28 |
| - run: | |
29 |
| - # Idea: the regex matcher of Renovate keeps this string up to date automatically |
30 |
| - # The version is extracted and used to access the correct version of the scripts |
31 |
| - USES=$(cat <<TRICK_RENOVATE |
32 |
| - - uses: DanySK/Template-for-Gradle-Plugins@cb970302120bb0b6a01ab495695a9f31babb83c7 |
33 |
| - TRICK_RENOVATE |
34 |
| - ) |
35 |
| - echo "Scripts update line: \"$USES\"" |
36 |
| - echo "Computed version: \"${USES#*@}\"" |
37 |
| - echo "::set-output name=version::${USES#*@}" |
38 | 47 | - name: Checkout test repo
|
39 | 48 | uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
40 | 49 | with:
|
41 |
| - repository: DanySK/Template-for-Gradle-Plugins |
| 50 | + repository: ${{ matrix.test[0] }} |
42 | 51 | path: 'target'
|
43 |
| - ref: ${{ steps.trick.outputs.version }} |
| 52 | + ref: ${{ matrix.test[1] }} |
44 | 53 | - uses: ./action
|
45 | 54 | with:
|
46 | 55 | build-command: ./gradlew tasks
|
|
61 | 70 | - name: Checkout
|
62 | 71 | uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
63 | 72 | with:
|
64 |
| - token: ${{ secrets.DEPLOYMENT_TOKEN }} |
| 73 | + token: ${{ secrets.DEPLOYMENT_TOKEN }} |
65 | 74 | - name: Semantic Release
|
66 | 75 | env:
|
67 | 76 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
71 | 80 | success:
|
72 | 81 | runs-on: ubuntu-22.04
|
73 | 82 | needs:
|
| 83 | + - select-tests |
74 | 84 | - test
|
75 | 85 | - release
|
76 | 86 | if: >-
|
|
0 commit comments