put all tests in a matrix

develop
Myk Taylor 2023-08-03 21:49:26 -07:00
parent 081e938301
commit f28b46922c
No known key found for this signature in database
2 changed files with 37 additions and 35 deletions

@ -46,45 +46,66 @@ jobs:
plugins: "all" plugins: "all"
test-windows: test-windows:
name: Test (Windows, MSVC, default plugins) name: Test (${{ matrix.os }}, ${{ matrix.compiler }}, ${{ matrix.plugins }} plugins)
needs: build-windows needs:
runs-on: windows-latest - 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: steps:
- name: Set env - name: Set env (windows)
if: matrix.os == 'windows'
run: echo "DF_FOLDER=DF" >> $env:GITHUB_ENV 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 - name: Clone DFHack
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
repository: 'DFHack/dfhack' repository: 'DFHack/dfhack'
ref: ${{ inputs.dfhack_ref }} ref: ${{ inputs.dfhack_ref }}
sparse-checkout: | - name: Detect DF version (windows)
CMakeLists.txt if: matrix.os == 'windows'
ci/ run: echo DF_VERSION="$(sh ci/get-df-version.sh)" >> $env:GITHUB_ENV
- name: Detect DF version - name: Detect DF version (posix)
id: get-df-version if: matrix.os != 'windows'
run: echo ver="$(sh ci/get-df-version.sh)" >> $env:GITHUB_OUTPUT run: echo DF_VERSION="$(sh ci/get-df-version.sh)" >> $GITHUB_ENV
- name: Fetch DF cache - name: Fetch DF cache
id: restore-df id: restore-df
uses: actions/cache/restore@v3 uses: actions/cache/restore@v3
with: with:
path: ${{ env.DF_FOLDER }} 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 - name: Download DF
if: steps.restore-df.outputs.cache-hit != 'true' 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 - name: Save DF cache
if: steps.restore-df.outputs.cache-hit != 'true' if: steps.restore-df.outputs.cache-hit != 'true'
uses: actions/cache/save@v3 uses: actions/cache/save@v3
with: with:
path: ${{ env.DF_FOLDER }} 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 - name: Download DFHack
uses: actions/download-artifact@v3 uses: actions/download-artifact@v3
with: with:
name: test-msvc name: test-${{ matrix.compiler }}
path: ${{ env.DF_FOLDER }} path: ${{ env.DF_FOLDER }}
- name: Run lua tests - name: Run lua tests
id: run-tests
timeout-minutes: 10 timeout-minutes: 10
run: python ci/run-tests.py --keep-status "${{ env.DF_FOLDER }}" run: python ci/run-tests.py --keep-status "${{ env.DF_FOLDER }}"
- name: Check RPC interface - name: Check RPC interface
@ -99,22 +120,3 @@ jobs:
${{ env.DF_FOLDER }}/dfhack-rpc.txt ${{ env.DF_FOLDER }}/dfhack-rpc.txt
${{ env.DF_FOLDER }}/test*.json ${{ env.DF_FOLDER }}/test*.json
${{ env.DF_FOLDER }}/*.log ${{ 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

@ -14,7 +14,7 @@ if test "$OS_TARGET" = "windows"; then
df_url="${df_url}_win_s.zip" df_url="${df_url}_win_s.zip"
df_archive_name="df.zip" df_archive_name="df.zip"
df_extract_cmd="unzip -d ${DF_FOLDER}" df_extract_cmd="unzip -d ${DF_FOLDER}"
elif test "$OS_TARGET" = "linux"; then elif test "$OS_TARGET" = "ubuntu"; then
WGET=wget WGET=wget
df_url="${df_url}_linux.tar.bz2" df_url="${df_url}_linux.tar.bz2"
df_archive_name="df.tar.bz2" df_archive_name="df.tar.bz2"