name: PR Checks on: pull_request: branches: - master - '[0-9]+.[0-9]+-dev' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: test: strategy: matrix: include: - platform: windows os: windows-latest os_short: win - platform: linux os: ubuntu-latest os_short: linux container_image: ghcr.io/alliedmodders/build-containers/debian11-clang22:latest fail-fast: false runs-on: ${{ matrix.os }} container: image: ${{ matrix.container_image }} name: ${{ matrix.os_short }} env: SDKS: '["episode1","css","tf2","l4d2","csgo","dods"]' ARCH: x86,x86_64 MYSQL_VERSION: '5.7' MMSOURCE_VERSION: '1.12' steps: - uses: actions/checkout@v6 with: submodules: recursive path: sourcemod # Largely a workaround for issue where github.workspace doesn't match $GITHUB_WORKSPACE # in containerized jobs. See https://github.com/actions/runner/issues/2058 - name: Resolve paths id: path_helper shell: bash run: | echo "dependencies=$GITHUB_WORKSPACE/dependencies" >> $GITHUB_OUTPUT - name: Cache dependencies uses: actions/cache@v5 env: cache-name: hl2sdk-mysql-mmsource with: path: ${{ steps.path_helper.outputs.dependencies }} key: ${{ runner.os }}-build-${{ env.cache-name }}-mysql${{ env.MYSQL_VERSION }}-mmsource${{ env.MMSOURCE_VERSION }}-${{ join(fromJSON(env.SDKS), '') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}-mysql${{ env.MYSQL_VERSION }}-mmsource${{ env.MMSOURCE_VERSION }}- ${{ runner.os }}-build-${{ env.cache-name }}-mysql${{ env.MYSQL_VERSION }}- - name: Install dependencies shell: bash run: | mkdir -p '${{ steps.path_helper.outputs.dependencies }}' cd '${{ steps.path_helper.outputs.dependencies }}' # Satisfy checkout-deps requirement for a "sourcemod" folder. mkdir -p sourcemod ../sourcemod/tools/checkout-deps.sh -s ${{ join(fromJSON(env.SDKS), ',') }} - name: Build working-directory: sourcemod shell: bash run: | mkdir build cd build python3 ../configure.py \ --enable-optimize \ --sdks=${{ join(fromJSON(env.SDKS), ',') }} \ --targets=${{ env.ARCH }} \ '--mms-path=${{ steps.path_helper.outputs.dependencies }}/mmsource-${{ env.MMSOURCE_VERSION }}' \ '--hl2sdk-root=${{ steps.path_helper.outputs.dependencies }}' \ '--mysql-path=${{ steps.path_helper.outputs.dependencies }}/mysql-${{ env.MYSQL_VERSION }}' \ '--mysql64-path=${{ steps.path_helper.outputs.dependencies }}/mysql-${{ env.MYSQL_VERSION }}-x86_64' ambuild