Skip to content

Implement in-game recent activity #4068

Implement in-game recent activity

Implement in-game recent activity #4068

Workflow file for this run

on: [ push, pull_request ]
name: Continuous Integration
# Inspired by osu! lazer's CI
# https://github.com/ppy/osu/blob/e12249f1270a22cf5811a8bb7a9ee44f2c0250db/.github/workflows/ci.yml
jobs:
test:
name: Build & Test
if: "!startsWith(github.event.head_commit.message, '[skip ci]')"
runs-on: ${{matrix.os.fullName}}
strategy:
fail-fast: false
matrix:
os:
- { prettyName: Linux, fullName: ubuntu-latest, database: true, webTest: true }
timeout-minutes: 5
env:
DB_DATABASE: lighthouse_tests
DB_USER: root
DB_PASSWORD: lighthouse_tests
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Start MySQL
if: ${{ matrix.os.database }}
uses: shogo82148/[email protected]
with:
mysql-version: '8.0'
root-password: ${{ env.DB_PASSWORD }}
- name: Create Lighthouse Database
if: ${{ matrix.os.database }}
run: mysql -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} -h 127.0.0.1 -e "CREATE DATABASE ${{ env.DB_DATABASE }};";
- name: Install .NET 8.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: "8.0.x"
- name: Compile
run: |
dotnet restore
dotnet build -c Release --no-restore
dotnet build -c Release --no-restore --no-dependencies ProjectLighthouse.Tests
dotnet build -c Release --no-restore --no-dependencies ProjectLighthouse.Tests.GameApiTests
dotnet build -c Release --no-restore --no-dependencies ProjectLighthouse.Tests.WebsiteTests
- name: Run tests on ProjectLighthouse.Tests
continue-on-error: true
run: dotnet test -c Release --no-build --logger "trx;LogFileName=${{github.workspace}}/TestResults-${{matrix.os.prettyName}}-Tests.trx" ProjectLighthouse.Tests
- name: Run tests on ProjectLighthouse.Tests.GameApiTests
continue-on-error: true
run: dotnet test -c Release --no-build --logger "trx;LogFileName=${{github.workspace}}/TestResults-${{matrix.os.prettyName}}-GameApiTests.trx" ProjectLighthouse.Tests.GameApiTests
- name: Run tests on ProjectLighthouse.Tests.WebsiteTests
if: ${{ matrix.os.webTest }}
continue-on-error: true
run: dotnet test -c Release --no-build --logger "trx;LogFileName=${{github.workspace}}/TestResults-${{matrix.os.prettyName}}-WebsiteTests.trx" ProjectLighthouse.Tests.WebsiteTests
# Attempt to upload results even if test fails.
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#always
- name: Upload Test Results
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: lighthouse-test-results-${{matrix.os.prettyName}}
path: ${{github.workspace}}/TestResults-${{matrix.os.prettyName}}-*.trx
- name: Process Test Results
id: process-trx
if: ${{ always() }}
uses: im-open/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
create-status-check: false
create-pr-comment: false
update-comment-if-one-exists: false
- name: Check Test Results
if: steps.process-trx.outputs.test-outcome == 'Failed'
run: |
echo "There were test failures."
exit 1