diff --git a/.github/workflows/periphery.yml b/.github/workflows/periphery.yml index b5367338..bde7cdbb 100644 --- a/.github/workflows/periphery.yml +++ b/.github/workflows/periphery.yml @@ -6,6 +6,12 @@ on: - main pull_request: +# A new push to a PR cancels the PR's older run. Other events get the run id +# as a unique group, so a run on main is never cancelled. +concurrency: + group: dead-code-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: periphery: name: Periphery scan diff --git a/.github/workflows/swift-tests.yml b/.github/workflows/swift-tests.yml index e64683de..066789f0 100644 --- a/.github/workflows/swift-tests.yml +++ b/.github/workflows/swift-tests.yml @@ -6,6 +6,12 @@ on: - main pull_request: +# A new push to a PR cancels the PR's older run. Other events get the run id +# as a unique group, so a run on main is never cancelled. +concurrency: + group: build-and-test-${{ github.event.pull_request.number || github.run_id }} + cancel-in-progress: true + jobs: test: name: Run Swift Tests (${{ matrix.name }}) @@ -36,24 +42,16 @@ jobs: # the runner image. A standalone swift.org toolchain (setup-swift) broke # whenever the image's Xcode moved ahead of it ("this SDK is not # supported by the compiler"). - - name: Note toolchain version (cache key) - id: swift-version - run: echo "version=$(swift --version 2>/dev/null | head -1 | shasum | cut -c1-12)" >> "$GITHUB_OUTPUT" - - - name: Cache build artifacts - uses: actions/cache@v4 - with: - path: ${{ matrix.path }}/.build - key: ${{ runner.os }}-${{ steps.swift-version.outputs.version }}-${{ matrix.name }}-${{ hashFiles(format('{0}/**/*.swift', matrix.path), format('{0}/**/Package.resolved', matrix.path)) }} - restore-keys: | - ${{ runner.os }}-${{ steps.swift-version.outputs.version }}-${{ matrix.name }}-${{ hashFiles(format('{0}/**/Package.resolved', matrix.path)) }} - ${{ runner.os }}-${{ steps.swift-version.outputs.version }}-${{ matrix.name }}- + - name: Show toolchain version + run: swift --version + # No .build cache: on a hit, SwiftPM still recompiled every module, and + # restoring and saving the cache took about 35 s in the app job. - name: Build tests # Built separately so the hang watchdog below times only test - # execution: a cold-cache coverage build on a slow runner can + # execution: a cold coverage build on a slow runner can # legitimately take several minutes, and is already bounded by the - # 15-minute job timeout. + # 25-minute job timeout. run: swift build --build-tests --enable-code-coverage --package-path ${{ matrix.path }} - name: Run Tests @@ -253,6 +251,8 @@ jobs: echo "Using iPhone simulator destination id: $destination_id" echo "id=$destination_id" >> "$GITHUB_OUTPUT" + # Coverage and the index store are off, because no step reads them. The + # SwiftPM job already gates the benchmarks, so they are skipped here. - name: Run iOS tests run: | set -o pipefail @@ -261,6 +261,9 @@ jobs: -sdk iphonesimulator \ -destination "platform=iOS Simulator,id=${{ steps.destination.outputs.id }}" \ -parallel-testing-enabled NO \ + -enableCodeCoverage NO \ + -skip-testing:bitchatTests_iOS/PerformanceBaselineTests \ + COMPILER_INDEX_STORE_ENABLE=NO \ CODE_SIGNING_ALLOWED=NO \ test diff --git a/.github/workflows/validate_georelays.yml b/.github/workflows/validate_georelays.yml index 09276d10..c52dd67b 100644 --- a/.github/workflows/validate_georelays.yml +++ b/.github/workflows/validate_georelays.yml @@ -18,8 +18,7 @@ on: permissions: contents: read -# A superseded run has nothing left to report; the sibling PR workflows do not -# set this, so drop it if the repo prefers them uniform. +# A superseded run has nothing left to report. concurrency: group: validate-georelays-${{ github.ref }} cancel-in-progress: true