diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0fb019abf..e5c884e64 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,15 @@ on: type: string jobs: + build-windows: + name: Windows MSVC + uses: ./.github/workflows/build-windows.yml + with: + dfhack_ref: ${{ inputs.dfhack_ref }} + structures_ref: ${{ inputs.structures_ref }} + artifact-name: test-msvc + cache-id: test + build-linux: name: Linux gcc-${{ matrix.gcc }} uses: ./.github/workflows/build-linux.yml @@ -33,6 +42,55 @@ jobs: - gcc: 12 plugins: "all" + test-windows: + name: Test (Windows, MSVC, default plugins) + needs: build-windows + runs-on: windows-latest + steps: + - name: Set env + 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 + - name: Detect DF version + id: get-df-version + run: echo ver="$(sh ci/get-df-version.sh)" >> $GITHUB_OUTPUT + - 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') }} + - 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 }} + - 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') }} + - name: Download DFHack + uses: actions/download-artifact@v3 + with: + name: test-msvc + path: ${{ env.DF_FOLDER }} + - name: Run lua tests + id: run-tests + run: python ci/run-tests.py --keep-status "${{ env.DF_FOLDER }}" + - name: Upload test artifacts + uses: actions/upload-artifact@v3 + if: always() + continue-on-error: true + with: + name: test-artifacts-msvc + path: | + ${{ env.DF_FOLDER }}/test*.json + ${{ env.DF_FOLDER }}/*.log + test-linux: name: Test (Linux, GCC ${{ matrix.gcc }}, ${{ matrix.plugins }} plugins) needs: build-linux diff --git a/ci/download-df.sh b/ci/download-df.sh index 8d94d54dd..0f7a5517b 100755 --- a/ci/download-df.sh +++ b/ci/download-df.sh @@ -1,52 +1,48 @@ #!/bin/sh +DF_FOLDER=$1 +OS_TARGET=$2 +DF_VERSION=$3 + set -e -df_tardest="df.tar.bz2" -save_tardest="test_save.tgz" - -cd "$(dirname "$0")" -echo "DF_VERSION: $DF_VERSION" -echo "DF_FOLDER: $DF_FOLDER" -mkdir -p "$DF_FOLDER" -# back out of df_linux -cd "$DF_FOLDER/.." - -if ! test -f "$df_tardest"; then - minor=$(echo "$DF_VERSION" | cut -d. -f2) - patch=$(echo "$DF_VERSION" | cut -d. -f3) - echo "Downloading DF $DF_VERSION" - while read url; do - echo "Attempting download: ${url}" - if wget -v "$url" -O "$df_tardest"; then - break - fi - done <