Skip to content

refactor and improve restarting #378

refactor and improve restarting

refactor and improve restarting #378

Workflow file for this run

name: Test
on:
push:
paths:
- 'tests/**/*.cs'
- 'source/**/*.cs'
- 'samples/**/*.cs'
- '.github/workflows/test.yml'
jobs:
test:
name: Test
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install .NET 7
uses: actions/setup-dotnet@v1
with:
dotnet-version: "7.0.x"
- name: Install Dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install -y \
--no-install-recommends \
mesa-utils \
libgl1-mesa-dev \
llvm-dev \
xvfb \
xauth
mkdir .staging
wget -O Xvfb.service https://gist.githubusercontent.com/ypandit/f4fe751bcbf3ee6a32ca/raw/f2f3a955e430e1f574c985cec0947d55496066d3/Xvfb.service
sudo mv Xvfb.service /etc/systemd/system/Xvfb.service
sudo systemctl daemon-reload
sudo systemctl start Xvfb
sudo systemctl status Xvfb
- name: Verify a dummy display exists
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
# check if display has been exported
if [ -z "$DISPLAY" ]; then
echo "DISPLAY is not set";
exit 1;
fi
glxinfo -B;
if [ $? -ne 0 ]; then
echo "glxinfo failed, no display available";
exit 1;
fi
env:
DISPLAY: ":99"
- name: Test
run: dotnet test /p:ContinuousIntegrationBuild=true /p:IncludeTestAssembly=true /p:CollectCoverage=true /p:CoverletOutput="../results/coverage.json" /p:MergeWith="../results/coverage.json" --logger trx --results-directory "./tests/results/"
env:
DISPLAY: ":99"
- name: Upload Results
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: results-${{ matrix.os }}
path: tests/results/
report:
name: Report
needs: test
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
steps:
- name: Download Results
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Publish Report
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: artifacts/**/*.trx
- name: Publish Coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: artifacts/results-ubuntu-latest/coverage.json