Added some docs and cleanup #101
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Test | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| merge_group: | |
| types: | |
| - checks_requested | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| DOTNET_NOLOGO: true | |
| jobs: | |
| test: | |
| name: Test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 15 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| - macos-latest | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| with: | |
| persist-credentials: false | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Build | |
| run: dotnet build Numos.slnx -c Release -warnaserror | |
| - name: Run tests | |
| run: dotnet test Numos.slnx -c Release --no-build --no-restore | |
| package: | |
| name: Pack and verify | |
| needs: test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| env: | |
| SOURCE_REF: ${{ github.ref }} | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Test version tooling | |
| run: python3 -m unittest discover -s eng/tests -v | |
| - name: Confirm clean source checkout | |
| run: | | |
| git diff --exit-code | |
| git diff --cached --exit-code | |
| - name: Pack release artifacts | |
| run: >- | |
| python3 eng/pack_packages.py all artifacts/packages | |
| --repository-commit "${{ github.sha }}" | |
| --repository-branch "$SOURCE_REF" | |
| - name: Verify package metadata and contents | |
| run: python3 eng/verify_packages.py artifacts/packages | |
| - name: Restore packages into a clean consumer | |
| shell: bash | |
| run: | | |
| consumer="$RUNNER_TEMP/numos-package-consumer" | |
| dotnet new console --framework net10.0 --output "$consumer" | |
| dotnet package add Numos.CoreSim --version "$(python3 eng/version.py get coresim)" --no-restore --project "$consumer" | |
| dotnet package add Numos.API.Dangerous --version "$(python3 eng/version.py get coresim)" --no-restore --project "$consumer" | |
| dotnet package add Numos.Viewer --version "$(python3 eng/version.py get viewer)" --no-restore --project "$consumer" | |
| cat > "$consumer/Program.cs" <<'EOF' | |
| using Numos.API; | |
| using Numos.API.Dangerous; | |
| using var simulation = new AtmosSimulation(); | |
| _ = simulation.Dangerous(); | |
| EOF | |
| dotnet restore "$consumer" \ | |
| --source "$GITHUB_WORKSPACE/artifacts/packages" \ | |
| --source https://api.nuget.org/v3/index.json | |
| dotnet build "$consumer" -c Release --no-restore -warnaserror | |
| test -f "$consumer/bin/Release/net10.0/assets/icon.png" | |
| test -f "$consumer/bin/Release/net10.0/assets/imgui-default.ini" | |
| - name: Verify NativeAOT publication | |
| run: | | |
| dotnet publish src/Numos.Viewer/Numos.Viewer.csproj \ | |
| -c Release \ | |
| -r linux-x64 \ | |
| -p:PublishAot=true \ | |
| -p:ContinuousIntegrationBuild=true \ | |
| -p:SourceRevisionId="${{ github.sha }}" \ | |
| -p:RepositoryCommit="${{ github.sha }}" \ | |
| -p:SourceBranchName="$SOURCE_REF" \ | |
| -p:RepositoryBranch="$SOURCE_REF" | |
| - name: Upload NuGet artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: nuget-packages | |
| path: artifacts/packages/*.*nupkg | |
| if-no-files-found: error |