diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0184350b4..17a0872fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -46,45 +46,66 @@ jobs: plugins: "all" test-windows: - name: Test (Windows, MSVC, default plugins) - needs: build-windows - runs-on: windows-latest + name: Test (${{ matrix.os }}, ${{ matrix.compiler }}, ${{ matrix.plugins }} plugins) + needs: + - build-windows + - build-linux + runs-on: ${{ matrix.os }}-latest + strategy: + fail-fast: false + matrix: + include: + - os: windows + compiler: msvc + plugins: "default" + # TODO: uncomment once we have a linux build we can download from bay12 + # - os: ubuntu + # compiler: gcc-10 + # gcc: 10 + # plugins: "default" + # - os: ubuntu + # compiler: gcc-10 + # gcc: 12 + # plugins: "all" steps: - - name: Set env + - name: Set env (windows) + if: matrix.os == 'windows' run: echo "DF_FOLDER=DF" >> $env:GITHUB_ENV + - name: Set env (posix) + if: matrix.os != 'windows' + run: echo "DF_FOLDER=DF" >> $GITHUB_ENV - name: Clone DFHack uses: actions/checkout@v3 with: repository: 'DFHack/dfhack' ref: ${{ inputs.dfhack_ref }} - sparse-checkout: | - CMakeLists.txt - ci/ - - name: Detect DF version - id: get-df-version - run: echo ver="$(sh ci/get-df-version.sh)" >> $env:GITHUB_OUTPUT + - name: Detect DF version (windows) + if: matrix.os == 'windows' + run: echo DF_VERSION="$(sh ci/get-df-version.sh)" >> $env:GITHUB_ENV + - name: Detect DF version (posix) + if: matrix.os != 'windows' + run: echo DF_VERSION="$(sh ci/get-df-version.sh)" >> $GITHUB_ENV - name: Fetch DF cache id: restore-df uses: actions/cache/restore@v3 with: path: ${{ env.DF_FOLDER }} - key: df-windows-${{ steps.get-df-version.outputs.ver }}-${{ hashFiles('ci/download-df.sh') }} + key: df-${{ matrix.os }}-${{ env.DF_VERSION }}-${{ hashFiles('ci/download-df.sh') }} - name: Download DF if: steps.restore-df.outputs.cache-hit != 'true' - run: sh ci/download-df.sh ${{ env.DF_FOLDER }} windows ${{ steps.get-df-version.outputs.ver }} + run: sh ci/download-df.sh ${{ env.DF_FOLDER }} ${{ matrix.os }} ${{ env.DF_VERSION }} - name: Save DF cache if: steps.restore-df.outputs.cache-hit != 'true' uses: actions/cache/save@v3 with: path: ${{ env.DF_FOLDER }} - key: df-windows-${{ steps.get-df-version.outputs.ver }}-${{ hashFiles('ci/download-df.sh') }} + key: df-${{ matrix.os }}-${{ env.DF_VERSION }}-${{ hashFiles('ci/download-df.sh') }} - name: Download DFHack uses: actions/download-artifact@v3 with: - name: test-msvc + name: test-${{ matrix.compiler }} path: ${{ env.DF_FOLDER }} - name: Run lua tests - id: run-tests timeout-minutes: 10 run: python ci/run-tests.py --keep-status "${{ env.DF_FOLDER }}" - name: Check RPC interface @@ -99,22 +120,3 @@ jobs: ${{ env.DF_FOLDER }}/dfhack-rpc.txt ${{ env.DF_FOLDER }}/test*.json ${{ env.DF_FOLDER }}/*.log - - test-linux: - name: Test (Linux, GCC ${{ matrix.gcc }}, ${{ matrix.plugins }} plugins) - needs: build-linux - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - gcc: 10 - plugins: "default" - - gcc: 12 - plugins: "all" - steps: - - name: Download artifact - uses: actions/download-artifact@v3 - with: - name: test-gcc-${{ matrix.gcc }} - # TODO: share windows test logic once there is a Linux DF build to test diff --git a/ci/download-df.sh b/ci/download-df.sh index 13c432798..12e9a41e3 100755 --- a/ci/download-df.sh +++ b/ci/download-df.sh @@ -14,7 +14,7 @@ if test "$OS_TARGET" = "windows"; then df_url="${df_url}_win_s.zip" df_archive_name="df.zip" df_extract_cmd="unzip -d ${DF_FOLDER}" -elif test "$OS_TARGET" = "linux"; then +elif test "$OS_TARGET" = "ubuntu"; then WGET=wget df_url="${df_url}_linux.tar.bz2" df_archive_name="df.tar.bz2"