diff --git a/.github/workflows/semantic-release.yml b/.github/workflows/semantic-release.yml index 212452e..6050415 100644 --- a/.github/workflows/semantic-release.yml +++ b/.github/workflows/semantic-release.yml @@ -9,7 +9,7 @@ jobs: semantic-release: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -52,14 +52,14 @@ jobs: failTitle: false" > .releaserc.yml - name: Setup Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: "lts/*" + node-version: '20' - name: Install semantic-release run: | - npm install semantic-release conventional-changelog-conventionalcommits -D - + npm install semantic-release@v24 conventional-changelog-conventionalcommits@v8 -D + npm list - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/swift-benchmark-delta.yml b/.github/workflows/swift-benchmark-delta.yml deleted file mode 100644 index e724c5e..0000000 --- a/.github/workflows/swift-benchmark-delta.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Benchmark PR vs main - -on: - workflow_dispatch: - pull_request: - branches: [ main ] - -jobs: - benchmark-delta: - - runs-on: ${{ matrix.os }} - continue-on-error: true - - strategy: - matrix: - #os: [[Linux, benchmark-swift-latest, self-hosted]] - os: [ubuntu-latest] - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Homebrew Mac - if: ${{ runner.os == 'Macos' }} - run: | - echo "/opt/homebrew/bin:/usr/local/bin" >> $GITHUB_PATH - brew install jemalloc - - - name: Ubuntu deps - if: ${{ runner.os == 'Linux' }} - run: | - sudo apt-get install -y libjemalloc-dev - - - name: Git URL token override and misc - run: | - #git config --global url."https://ordo-ci:${{ secrets.CI_MACHINE_PAT }}@github.com".insteadOf "https://github.com" - #/usr/bin/ordo-performance - [ -d Benchmarks ] && echo "hasBenchmark=1" >> $GITHUB_ENV - echo "/opt/homebrew/bin:/usr/local/bin" >> $GITHUB_PATH - - name: Run benchmarks for PR branch - if: ${{ env.hasBenchmark == '1' }} - run: | - swift package --allow-writing-to-directory .benchmarkBaselines/ benchmark baseline update pull_request --no-progress --quiet - - name: Switch to branch 'main' - if: ${{ env.hasBenchmark == '1' }} - run: | - git stash - git checkout main - - name: Run benchmarks for branch 'main' - if: ${{ env.hasBenchmark == '1' }} - run: | - swift package --allow-writing-to-directory .benchmarkBaselines/ benchmark baseline update main --no-progress --quiet - - name: Compare PR and main - if: ${{ env.hasBenchmark == '1' }} - id: benchmark - run: | - echo $(date) >> $GITHUB_STEP_SUMMARY - echo "exitStatus=1" >> $GITHUB_ENV - swift package benchmark baseline check main pull_request --format markdown >> $GITHUB_STEP_SUMMARY - echo "exitStatus=0" >> $GITHUB_ENV - continue-on-error: true - - if: ${{ env.exitStatus == '0' }} - name: Pull request comment text success - id: prtestsuccess - run: | - echo 'PRTEST<> $GITHUB_ENV - echo "[Pull request benchmark comparison [${{ matrix.os }}] with 'main' run at $(date -Iseconds)](https://github.com/ordo-one/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }})" >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV - - if: ${{ env.exitStatus == '1' }} - name: Pull request comment text failure - id: prtestfailure - run: | - echo 'PRTEST<> $GITHUB_ENV - echo "[Pull request benchmark comparison [${{ matrix.os }}] with 'main' run at $(date -Iseconds)](https://github.com/ordo-one/${{ github.event.repository.name }}/actions/runs/${{ github.run_id }})" >> $GITHUB_ENV - echo "_Pull request had performance regressions_" >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV - - name: Comment PR - if: ${{ env.hasBenchmark == '1' }} - uses: thollander/actions-comment-pull-request@v1 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - message: ${{ env.PRTEST }} - comment_includes: "Pull request benchmark comparison [${{ matrix.os }}] with" - - name: Exit with correct status - run: | - #/usr/bin/ordo-performance powersave - exit ${{ env.exitStatus }} diff --git a/.github/workflows/swift-check-api-breaks.yml b/.github/workflows/swift-check-api-breaks.yml index f14378e..40a20a9 100644 --- a/.github/workflows/swift-check-api-breaks.yml +++ b/.github/workflows/swift-check-api-breaks.yml @@ -12,7 +12,7 @@ jobs: timeout-minutes: 30 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Ubuntu deps diff --git a/.github/workflows/swift-code-coverage.yml b/.github/workflows/swift-code-coverage.yml index d60e2c8..7539d9e 100644 --- a/.github/workflows/swift-code-coverage.yml +++ b/.github/workflows/swift-code-coverage.yml @@ -11,17 +11,21 @@ jobs: runs-on: [ubuntu-22.04] timeout-minutes: 60 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Ubuntu deps if: ${{ runner.os == 'Linux' }} run: | - sudo apt-get install -y libjemalloc-dev llvm-15 + sudo apt-get install -y libjemalloc-dev + + - uses: swift-actions/setup-swift@v2 + + - name: Swift version + run: swift --version - name: Run tests continue-on-error: true - run: | - [ -d Tests ] && swift test --parallel --enable-code-coverage + run: swift test --parallel --enable-code-coverage - name: Export code coverage run: | @@ -32,12 +36,12 @@ jobs: fi if [ -f ${xctest_binary} ]; then - llvm-cov-15 export -format="lcov" ${xctest_binary} -instr-profile .build/debug/codecov/default.profdata > info.lcov + llvm-cov export -format="lcov" ${xctest_binary} -instr-profile .build/debug/codecov/default.profdata > info.lcov fi - name: Upload codecov - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v4 with: - token: ${{ secrets.CODECOV_REPO_TOKEN }} + token: ${{ secrets.CODECOV_REPO_TOKEN }} files: info.lcov fail_ci_if_error: true diff --git a/.github/workflows/swift-lint.yml b/.github/workflows/swift-lint.yml index 210183b..331f74c 100644 --- a/.github/workflows/swift-lint.yml +++ b/.github/workflows/swift-lint.yml @@ -13,7 +13,7 @@ jobs: timeout-minutes: 60 runs-on: [ubuntu-latest] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: GitHub Action for SwiftLint with --strict uses: norio-nomura/action-swiftlint@3.2.1 with: diff --git a/.github/workflows/swift-linux-build.yml b/.github/workflows/swift-linux-build.yml index c189e5f..af5d9d1 100644 --- a/.github/workflows/swift-linux-build.yml +++ b/.github/workflows/swift-linux-build.yml @@ -1,4 +1,4 @@ -name: Swift Linux build +name: Linux build on: workflow_dispatch: @@ -14,17 +14,17 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - swift: ["5.7", "5.8"] - +# swift: [ "5.10", "6.0" ] runs-on: ${{ matrix.os }} steps: - - uses: fwal/setup-swift@v1.23.0 + - uses: swift-actions/setup-swift@v2 + if: ${{ false }} with: swift-version: ${{ matrix.swift }} - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Ubuntu deps if: ${{ runner.os == 'Linux' }} @@ -38,5 +38,7 @@ jobs: run: swift build - name: Run tests - run: | - [ -d Tests ] && swift test --parallel + run: swift test --parallel + + - name: Run tests (release) + run: swift test -c release --parallel diff --git a/.github/workflows/swift-macos-build.yml b/.github/workflows/swift-macos-build.yml index 9e5dac6..a72a065 100644 --- a/.github/workflows/swift-macos-build.yml +++ b/.github/workflows/swift-macos-build.yml @@ -1,4 +1,4 @@ -name: Swift macOS build +name: macOS build on: workflow_dispatch: @@ -6,20 +6,21 @@ on: branches: [ main ] pull_request: branches: [ main ] - + jobs: build-macos: timeout-minutes: 60 strategy: fail-fast: false matrix: - os: [macos-13] - swift: ["5.7", "5.8"] + os: [macos-15] +# swift: [ "5.10", "6.0" ] runs-on: ${{ matrix.os }} steps: - - uses: fwal/setup-swift@v1.24.0 + - uses: swift-actions/setup-swift@v2 + if: ${{ false }} with: swift-version: ${{ matrix.swift }} @@ -29,18 +30,22 @@ jobs: echo "/opt/homebrew/bin:/usr/local/bin" >> $GITHUB_PATH echo BENCHMARK_DISABLE_JEMALLOC=true >> $GITHUB_ENV brew install jemalloc - - uses: actions/checkout@v3 + + - uses: actions/checkout@v4 + + - name: GH auth + run: | + echo "machine api.github.com login ${{ secrets.GITHUB_TOKEN }} password x-oauth-basic" > $HOME/.netrc + cat ~/.netrc + - name: Swift version run: swift --version + - name: Build run: swift build + - name: Run tests - run: | - if [ -d Tests ]; then - swift test --parallel - fi + run: swift test --parallel + - name: Run tests (release) - run: | - if [ -d Tests ]; then - swift test -c release --parallel - fi + run: swift test -c release --parallel diff --git a/.github/workflows/swift-outdated-dependencies.yml b/.github/workflows/swift-outdated-dependencies.yml index 8d45ba5..8ed989e 100644 --- a/.github/workflows/swift-outdated-dependencies.yml +++ b/.github/workflows/swift-outdated-dependencies.yml @@ -10,16 +10,16 @@ jobs: runs-on: [ubuntu-latest] timeout-minutes: 60 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check Swift package dependencies id: spm-dep-check - uses: MarcoEidinger/swift-package-dependencies-check@2.3.4 + uses: MarcoEidinger/swift-package-dependencies-check@2.5.0 with: isMutating: true failWhenOutdated: false - name: Create Pull Request if: steps.spm-dep-check.outputs.outdatedDependencies == 'true' - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v7 with: commit-message: 'chore: update package dependencies' branch: updatePackageDepedencies diff --git a/.github/workflows/swift-sanitizer-address.yml b/.github/workflows/swift-sanitizer-address.yml index 82217a2..dddeb36 100644 --- a/.github/workflows/swift-sanitizer-address.yml +++ b/.github/workflows/swift-sanitizer-address.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: [macos-15] runs-on: ${{ matrix.os }} timeout-minutes: 60 @@ -29,7 +29,7 @@ jobs: run: | sudo apt-get install -y libjemalloc-dev - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Swift version run: swift --version @@ -40,9 +40,9 @@ jobs: - name: Run address sanitizer run: swift test --sanitize=address - + - name: Clean before release build sanitizier run: swift package clean - + - name: Run address sanitizer on release build run: swift test --sanitize=address -c release -Xswiftc -enable-testing diff --git a/.github/workflows/swift-sanitizer-thread.yml b/.github/workflows/swift-sanitizer-thread.yml index c187150..437b1a9 100644 --- a/.github/workflows/swift-sanitizer-thread.yml +++ b/.github/workflows/swift-sanitizer-thread.yml @@ -30,7 +30,7 @@ jobs: sudo apt-get install -y libjemalloc-dev echo BENCHMARK_DISABLE_JEMALLOC=true >> $GITHUB_ENV - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Swift version run: swift --version @@ -41,9 +41,9 @@ jobs: - name: Run thread sanitizer run: swift test --sanitize=thread - + - name: Clean before release build sanitizier run: swift package clean - + - name: Run thread sanitizer on release build run: swift test --sanitize=thread -c release -Xswiftc -enable-testing diff --git a/.gitignore b/.gitignore index 0dea6af..b02bd57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,3 @@ -#################################################################### -# DO NOT EDIT THIS FILE MANUALLY -# This is a master file maintained in https://github.com/ordo-one/repository-templates - # Xcode # # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore diff --git a/.swiftlint.yml b/.swiftlint.yml index 347c8e5..3497766 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,10 +1,4 @@ #################################################################### -# DO NOT EDIT THIS FILE -# This is a master file maintained in https://github.com/ordo-one/public-repository-templates -# -# Add overrides into `swiftlint_refinement.yml` in the directory it self or -# .swiftlint.yml under the specific directory where the code is located -# # Documentation is under https://github.com/realm/SwiftLint #################################################################### diff --git a/Tests/HistogramTests/HistogramDataAccessTests.swift b/Tests/HistogramTests/HistogramDataAccessTests.swift index baeee9d..29da808 100644 --- a/Tests/HistogramTests/HistogramDataAccessTests.swift +++ b/Tests/HistogramTests/HistogramDataAccessTests.swift @@ -36,7 +36,7 @@ final class HistogramDataAccessTests: XCTestCase { numberOfSignificantValueDigits: numberOfSignificantValueDigits ) - override class func setUp() { + override static func setUp() { // Log hypothetical scenario: 100 seconds of "perfect" 1msec results, sampled // 100 times per second (10,000 results), followed by a 100 second pause with // a single (100 second) recorded result. Recording is done indicating an expected