SF-3586 Fix incorrect deletion of audio when editing comment #12972
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
| # Github Action to build and run tests | |
| name: Build | |
| permissions: {} | |
| on: | |
| push: | |
| branches: [develop, master, sf-qa, sf-live] | |
| pull_request: | |
| merge_group: | |
| workflow_dispatch: | |
| jobs: | |
| build-development: | |
| name: "Build and test" | |
| strategy: | |
| matrix: | |
| # Environments in which to run, such as those used in development and production, or which are candidates to | |
| # move to. | |
| os: ["ubuntu-24.04"] | |
| dotnet_version: ["10.0.x"] | |
| node_version: ["22.13.0"] | |
| npm_version: ["11.11.0"] | |
| pnpm_version: ["11.10.0"] | |
| # Continue building in other environments to see which are working. | |
| fail-fast: false | |
| runs-on: ${{matrix.os}} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: "Deps: .NET" | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | |
| with: | |
| dotnet-version: ${{matrix.dotnet_version}} | |
| cache: true | |
| cache-dependency-path: src/SIL.XForge.Scripture/packages.lock.json | |
| - name: "Deps: pnpm" | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| version: ${{matrix.pnpm_version}} | |
| - name: "Deps: Node" | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: ${{matrix.node_version}} | |
| cache: "pnpm" | |
| cache-dependency-path: | | |
| src/SIL.XForge.Scripture/ClientApp/pnpm-lock.yaml | |
| src/RealtimeServer/pnpm-lock.yaml | |
| - name: "Deps: npm" | |
| env: | |
| NPM_VERSION: ${{matrix.npm_version}} | |
| run: | | |
| set -xueo pipefail | |
| npm install --global npm@${NPM_VERSION} | |
| - name: Pre-build report | |
| run: | | |
| set -xueo pipefail | |
| lsb_release -a | |
| which dotnet | |
| dotnet --version | |
| dotnet --list-sdks | |
| dotnet --list-runtimes | |
| which node | |
| node --version | |
| which npm | |
| npm --version | |
| which pnpm | |
| pnpm --version | |
| which chromium-browser | |
| chromium-browser --version | |
| - name: "Ensure desired tool versions" | |
| # The build machine may come with newer tools than we are ready for. | |
| env: | |
| NODE_VERSION: ${{matrix.node_version}} | |
| NPM_VERSION: ${{matrix.npm_version}} | |
| PNPM_VERSION: ${{matrix.pnpm_version}} | |
| run: | | |
| set -xueo pipefail | |
| [[ $(node --version) == v${NODE_VERSION} ]] | |
| [[ $(npm --version) == ${NPM_VERSION} ]] | |
| [[ $(pnpm --version) == ${PNPM_VERSION} ]] | |
| - name: "Deps: reportgenerator tool" | |
| run: dotnet tool install --global dotnet-reportgenerator-globaltool | |
| - name: "Deps: RealtimeServer pnpm" | |
| run: cd src/RealtimeServer && (pnpm ci || (sleep 3m && pnpm ci)) | |
| - name: "Deps: Backend nuget" | |
| run: dotnet restore | |
| - name: "Deps: Frontend pnpm" | |
| run: cd src/SIL.XForge.Scripture/ClientApp && (pnpm ci || (sleep 3m && pnpm ci)) | |
| - name: "Build: Backend, RealtimeServer" | |
| run: dotnet build xForge.sln | |
| - name: "Build: Frontend" | |
| run: cd src/SIL.XForge.Scripture/ClientApp && pnpm run build | |
| - name: "Test: Ensure tests not focused on a subset" | |
| # grep returns code 123 when no matches are found. The operator ! negates the exit code. | |
| run: | | |
| ! git ls-files | grep "\\.spec\\.ts" | xargs grep -P "^\s*(fdescribe|fit)\(" | |
| - name: "Test: RealtimeServer" | |
| run: cd src/RealtimeServer && pnpm run test:ci | |
| - name: "Test: Backend" | |
| run: | | |
| dotnet test \ | |
| --logger:"junit;LogFileName=junit.xml" \ | |
| -p:CollectCoverage=true \ | |
| -e:CoverletOutputFormat=opencover \ | |
| -e:Exclude=\"[NUnit3.TestAdapter]*,[SIL.XForge.*.Views]*,[SIL.XForge.Tests]*\" | |
| # Run the tests while making sure none of the common/known warnings are printed | |
| - name: "Test: Frontend" | |
| run: | | |
| set -euo pipefail | |
| cd src/SIL.XForge.Scripture/ClientApp | |
| pnpm run test:gha | tee test_output.log | |
| if grep --perl-regex '\bNG\d+\b|ERROR:|WARN:|LOG:|INFO:' test_output.log; then | |
| echo "Error: Disallowed token found in test run output, as shown above."; | |
| exit 1; | |
| fi | |
| - name: "Coverage: Backend" | |
| run: | | |
| reportgenerator \ | |
| -reports:test/*/coverage.opencover.xml \ | |
| -targetdir:coverage \ | |
| "-reporttypes:HTML;TeamCitySummary" | |
| - name: "Coverage: Publish to Codecov" | |
| uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 | |
| with: | |
| report_type: coverage | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: "Test: Publish test results to Codecov" | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1 | |
| with: | |
| report_type: test_results | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| build-production: | |
| name: "Production build and test" | |
| strategy: | |
| matrix: | |
| os: ["ubuntu-24.04"] | |
| dotnet_version: ["10.0.x"] | |
| node_version: ["22.13.0"] | |
| npm_version: ["11.11.0"] | |
| pnpm_version: ["11.10.0"] | |
| fail-fast: false | |
| runs-on: ${{matrix.os}} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: "Deps: .NET" | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | |
| with: | |
| dotnet-version: ${{matrix.dotnet_version}} | |
| cache: true | |
| cache-dependency-path: src/SIL.XForge.Scripture/packages.lock.json | |
| - name: "Deps: pnpm" | |
| uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9 | |
| with: | |
| version: ${{matrix.pnpm_version}} | |
| - name: "Deps: Node" | |
| uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| with: | |
| node-version: ${{matrix.node_version}} | |
| cache: "pnpm" | |
| cache-dependency-path: | | |
| src/SIL.XForge.Scripture/ClientApp/pnpm-lock.yaml | |
| src/RealtimeServer/pnpm-lock.yaml | |
| - name: "Deps: npm" | |
| env: | |
| NPM_VERSION: ${{matrix.npm_version}} | |
| run: | | |
| set -xueo pipefail | |
| npm install --global npm@${NPM_VERSION} | |
| - name: Pre-build report | |
| run: | | |
| set -xueo pipefail | |
| lsb_release -a | |
| which dotnet | |
| dotnet --version | |
| dotnet --list-sdks | |
| dotnet --list-runtimes | |
| which node | |
| node --version | |
| which npm | |
| npm --version | |
| which pnpm | |
| pnpm --version | |
| which chromium-browser | |
| chromium-browser --version | |
| - name: "Ensure desired tool versions" | |
| env: | |
| NODE_VERSION: ${{matrix.node_version}} | |
| NPM_VERSION: ${{matrix.npm_version}} | |
| PNPM_VERSION: ${{matrix.pnpm_version}} | |
| run: | | |
| set -xueo pipefail | |
| [[ $(node --version) == v${NODE_VERSION} ]] | |
| [[ $(npm --version) == ${NPM_VERSION} ]] | |
| [[ $(pnpm --version) == ${PNPM_VERSION} ]] | |
| - name: "Production build" | |
| run: scripts/build-production | |
| - name: "Test: Backend" | |
| run: dotnet test xForge.sln | |
| - name: "Test: RealtimeServer" | |
| run: cd src/RealtimeServer && pnpm run test:ci | |
| - name: "Test: Frontend" | |
| run: cd src/SIL.XForge.Scripture/ClientApp && pnpm run test:gha |