|
11 | 11 | branches: main |
12 | 12 |
|
13 | 13 | env: |
14 | | - JAVA_VERSION: '17.0.1' |
| 14 | + JAVA_VERSION: 17 |
15 | 15 |
|
16 | 16 | jobs: |
17 | 17 | build: |
@@ -43,6 +43,100 @@ jobs: |
43 | 43 | path: dist |
44 | 44 | retention-days: 30 |
45 | 45 |
|
| 46 | + test: |
| 47 | + needs: build |
| 48 | + strategy: |
| 49 | + fail-fast: false |
| 50 | + matrix: |
| 51 | + env: |
| 52 | + - server |
| 53 | + - client |
| 54 | + modloader: |
| 55 | + - fabric |
| 56 | + - forge |
| 57 | + include: |
| 58 | + - modloader: fabric |
| 59 | + mc-runtime-test: fabric |
| 60 | + fabric-api: 0.87.0 |
| 61 | + dependencies: >- |
| 62 | + 'https://cdn.modrinth.com/data/Ha28R6CL/versions/vlhvI5Li/fabric-language-kotlin-1.10.18%2Bkotlin.1.9.22.jar' |
| 63 | + 'https://cdn.modrinth.com/data/9s6osm5g/versions/s7VTKfLA/cloth-config-11.1.106-fabric.jar' |
| 64 | + 'https://cdn.modrinth.com/data/TZo2wHFe/versions/dabyDTwJ/paucal-0.6.0%2B1.20.1-fabric.jar' |
| 65 | + 'https://cdn.modrinth.com/data/fin1PX4m/versions/fBoxabC2/inline-fabric-1.20.1-1.0.1.jar' |
| 66 | + 'https://cdn.modrinth.com/data/K01OU20C/versions/HykM2Qyv/cardinal-components-api-5.2.1.jar' |
| 67 | + 'https://cdn.modrinth.com/data/nU0bVIaL/versions/Y6tuH1cn/Patchouli-1.20.1-84-FABRIC.jar' |
| 68 | + 'https://cdn.modrinth.com/data/mOgUt4GM/versions/zv46i3PW/modmenu-7.1.0.jar' |
| 69 | + 'https://cdn.modrinth.com/data/5aaWibi9/versions/z8ProfKL/trinkets-3.7.0.jar' |
| 70 | + - modloader: forge |
| 71 | + mc-runtime-test: lexforge |
| 72 | + fabric-api: none |
| 73 | + dependencies: >- |
| 74 | + 'https://cdn.modrinth.com/data/ordsPcFz/versions/9j6YaPp2/kotlinforforge-4.10.0-all.jar' |
| 75 | + 'https://cdn.modrinth.com/data/9s6osm5g/versions/JoLgnJ0G/cloth-config-11.1.106-forge.jar' |
| 76 | + 'https://cdn.modrinth.com/data/TZo2wHFe/versions/HyBiJPtT/paucal-0.6.0%2B1.20.1-forge.jar' |
| 77 | + 'https://cdn.modrinth.com/data/fin1PX4m/versions/huiPd6Lc/inline-forge-1.20.1-1.0.1.jar' |
| 78 | + 'https://cdn.modrinth.com/data/40FYwb4z/versions/fs9CeXYZ/caelus-forge-3.1.0%2B1.20.jar' |
| 79 | + 'https://cdn.modrinth.com/data/nU0bVIaL/versions/JMtc0mTS/Patchouli-1.20.1-84-FORGE.jar' |
| 80 | + runs-on: ubuntu-latest |
| 81 | + steps: |
| 82 | + - uses: actions/setup-java@v4 |
| 83 | + with: |
| 84 | + distribution: temurin |
| 85 | + java-version: ${{ env.JAVA_VERSION }} |
| 86 | + |
| 87 | + - name: Create cache key |
| 88 | + run: | |
| 89 | + cat <<END_OF_FILE > dependencies.txt |
| 90 | + ${{ matrix.dependencies }} |
| 91 | + END_OF_FILE |
| 92 | +
|
| 93 | + - name: Cache dependencies |
| 94 | + id: cache |
| 95 | + uses: actions/cache@v4 |
| 96 | + with: |
| 97 | + path: run/mods |
| 98 | + key: ${{ hashFiles('dependencies.txt') }} |
| 99 | + |
| 100 | + - name: Download dependencies |
| 101 | + if: steps.cache.outputs.cache-hit != 'true' |
| 102 | + run: | |
| 103 | + for url in ${{ matrix.dependencies }}; do |
| 104 | + wget --directory-prefix=run/mods/ "$url" |
| 105 | + done |
| 106 | +
|
| 107 | + - name: Download build artifacts |
| 108 | + uses: actions/download-artifact@v4 |
| 109 | + with: |
| 110 | + name: mod-build |
| 111 | + path: dist |
| 112 | + |
| 113 | + - name: Prepare mod jar |
| 114 | + run: | |
| 115 | + rm -f dist/*-javadoc.jar dist/*-sources.jar |
| 116 | + cp dist/hexcasting-${{ matrix.modloader }}-*.jar run/mods |
| 117 | +
|
| 118 | + - name: Run MC test client |
| 119 | + if: matrix.env == 'client' |
| 120 | + timeout-minutes: 10 |
| 121 | + uses: headlesshq/[email protected] |
| 122 | + with: |
| 123 | + java: ${{ env.JAVA_VERSION }} |
| 124 | + mc: 1.20.1 |
| 125 | + modloader: ${{ matrix.modloader }} |
| 126 | + regex: '.*${{ matrix.modloader }}.*' |
| 127 | + fabric-api: ${{ matrix.fabric-api }} |
| 128 | + mc-runtime-test: ${{ matrix.mc-runtime-test }} |
| 129 | + |
| 130 | + - name: Run MC test server |
| 131 | + if: matrix.env == 'server' |
| 132 | + timeout-minutes: 10 |
| 133 | + uses: headlesshq/[email protected] |
| 134 | + with: |
| 135 | + java: ${{ env.JAVA_VERSION }} |
| 136 | + mc: 1.20.1 |
| 137 | + modloader: ${{ matrix.modloader }} |
| 138 | + fabric-api: ${{ matrix.fabric-api }} |
| 139 | + |
46 | 140 | datagen: |
47 | 141 | runs-on: ubuntu-latest |
48 | 142 | steps: |
|
0 commit comments