pr.yml (2573B)
1 name: PR Build 2 3 env: 4 # Set up vcpkg to read from the GitHub cache (https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache) 5 VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite' 6 7 on: 8 pull_request: 9 branches: [ "main" ] 10 11 jobs: 12 build-windows: 13 runs-on: 'windows-latest' 14 15 steps: 16 - uses: actions/checkout@v4 17 18 - name: Set up required environment variables for vcpkg cache 19 uses: actions/github-script@v7 20 with: 21 script: | 22 core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); 23 core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); 24 25 - name: Initialize CodeQL 26 uses: ./.github/workflows/initialize-codeql 27 28 - name: Install Winget 29 uses: ./.github/workflows/install-winget 30 31 - name: Setup 32 shell: pwsh 33 run: .\scripts\Setup.ps1 34 35 - name: Check formatting 36 shell: pwsh 37 run: python .\scripts\check-format.py 38 39 - name: Build and Test (no test overrides) 40 shell: pwsh 41 run: | 42 .\scripts\Build.ps1 43 .\scripts\Test.ps1 -OutputOnFailure 44 45 - name: Build and Test (with test overrides) 46 shell: pwsh 47 run: | 48 .\scripts\Build.ps1 -EnableTestOverrides 49 .\scripts\Test.ps1 -OutputOnFailure 50 51 - name: Perform CodeQL Analysis 52 uses: github/codeql-action/analyze@v3 53 54 build-ubuntu: 55 runs-on: ubuntu-latest 56 57 steps: 58 - uses: actions/checkout@v4 59 60 - name: Set up required environment variables for vcpkg cache 61 uses: actions/github-script@v7 62 with: 63 script: | 64 core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); 65 core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); 66 67 - name: Initialize CodeQL 68 uses: ./.github/workflows/initialize-codeql 69 70 - name: Setup 71 run: source ./scripts/setup.sh 72 73 - name: Check formatting 74 run: python ./scripts/check-format.py 75 76 - name: Build and Test (no test overrides) 77 run: | 78 ./scripts/build.sh 79 ./scripts/test.sh --output-on-failure 80 81 - name: Build and Test (with test overrides) 82 run: | 83 ./scripts/build.sh --enable-test-overrides 84 ./scripts/test.sh --output-on-failure 85 86 - name: Perform CodeQL Analysis 87 uses: github/codeql-action/analyze@v3