From be88b5b59caedef8a52286fca729cc9836b29012 Mon Sep 17 00:00:00 2001 From: Christian Treffs Date: Mon, 21 Oct 2024 16:55:12 +0200 Subject: [PATCH] Update project (#25) * Update renovate.json * Update CI * Shorter job workflow names * Fix accuracy on macOS --- .github/workflows/ci-linux.yml | 31 ++++++++++--- .github/workflows/ci-macos-11.yml | 49 -------------------- .github/workflows/ci-macos.yml | 46 +++++++++--------- .github/workflows/ci-windows.yml | 36 +++++++++++--- Tests/FirebladeMathTests/FunctionTests.swift | 10 ++-- renovate.json | 11 ++++- 6 files changed, 90 insertions(+), 93 deletions(-) delete mode 100644 .github/workflows/ci-macos-11.yml diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml index c2cb009..5b1fbba 100644 --- a/.github/workflows/ci-linux.yml +++ b/.github/workflows/ci-linux.yml @@ -8,17 +8,36 @@ on: workflow_dispatch: jobs: - linux-test-build-release: + linux: runs-on: ubuntu-latest strategy: matrix: - swift: ["5.1", "latest"] + swift: ["latest"] container: image: swift:${{ matrix.swift }} steps: - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v4 + - name: Test - run: swift test -c release --skip-update --parallel --enable-code-coverage - - name: Build Release - run: swift build -c release + run: swift test -c release --enable-xctest --parallel --xunit-output .build/xUnit-output.xml + + - name: Upload artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: artifacts-linux-${{ matrix.swift }}-${{ github.run_id }} + path: | + .build/**/*.a + .build/**/*.bundle + .build/**/*.dSYM + .build/**/*.gdb + .build/**/*.json + .build/**/*.txt + .build/**/*.xctest + .build/*.json + .build/*.txt + .build/*.xml + .build/*.yaml + if-no-files-found: warn + include-hidden-files: true diff --git a/.github/workflows/ci-macos-11.yml b/.github/workflows/ci-macos-11.yml deleted file mode 100644 index 7bde42d..0000000 --- a/.github/workflows/ci-macos-11.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: macOS - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - workflow_dispatch: - -jobs: - macos-test-build-release-xcode: - runs-on: macos-11 - strategy: - matrix: - xcode: [11.7, 12.5.1] - steps: - - name: Checkout - uses: actions/checkout@v3.5.2 - - name: Select Xcode ${{ matrix.xcode }} - run: sudo xcode-select -s '/Applications/Xcode_${{ matrix.xcode }}.app' - - name: Test - run: make test - env: - DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - - name: Upload test artifacts - if: failure() - uses: actions/upload-artifact@v3.1.2 - with: - name: test-artifacts-${{ matrix.xcode }}-${{ github.run_id }} - path: | - .build/**/*.json - .build/**/*.xctest - - name: Build Release - run: make buildRelease - env: - DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - - name: Upload build artifacts - if: failure() - uses: actions/upload-artifact@v3.1.2 - with: - name: build-artifacts-${{ matrix.xcode }}-${{ github.run_id }} - path: | - *.lcov - .build/*.yaml - .build/**/*.a - .build/**/*.so - .build/**/*.dylib - .build/**/*.dSYM - .build/**/*.json diff --git a/.github/workflows/ci-macos.yml b/.github/workflows/ci-macos.yml index cf1729d..bad7cea 100644 --- a/.github/workflows/ci-macos.yml +++ b/.github/workflows/ci-macos.yml @@ -8,42 +8,40 @@ on: workflow_dispatch: jobs: - macos-test-build-release-xcode: + macos-xcode: runs-on: macos-latest strategy: matrix: - xcode: [13.4.1, 14.1] + xcode: ["14.3.1", "15.4", "16.0"] steps: - name: Checkout - uses: actions/checkout@v3.5.2 + uses: actions/checkout@v4 + - name: Select Xcode ${{ matrix.xcode }} run: sudo xcode-select -s '/Applications/Xcode_${{ matrix.xcode }}.app' + - name: Test - run: make test + run: swift test -c release --parallel --xunit-output .build/xUnit-output.xml env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - - name: Upload test artifacts - if: failure() - uses: actions/upload-artifact@v3.1.2 + + - name: Upload artifacts + if: always() + uses: actions/upload-artifact@v4.4.3 with: - name: test-artifacts-${{ matrix.xcode }}-${{ github.run_id }} + name: artifacts-macOS-${{ matrix.xcode }}-${{ github.run_id }} path: | + .build/**/*.a + .build/**/*.bundle + .build/**/*.dSYM + .build/**/*.gdb .build/**/*.json + .build/**/*.txt .build/**/*.xctest - - name: Build Release - run: make buildRelease - env: - DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer - - name: Upload build artifacts - if: failure() - uses: actions/upload-artifact@v3.1.2 - with: - name: build-artifacts-${{ matrix.xcode }}-${{ github.run_id }} - path: | - *.lcov + .build/*.json + .build/*.txt + .build/*.xml .build/*.yaml - .build/**/*.a - .build/**/*.so - .build/**/*.dylib - .build/**/*.dSYM - .build/**/*.json + if-no-files-found: warn + include-hidden-files: true + diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml index f693abb..fe2cde7 100644 --- a/.github/workflows/ci-windows.yml +++ b/.github/workflows/ci-windows.yml @@ -8,16 +8,38 @@ on: workflow_dispatch: jobs: - windows-test-build-release: + windows: runs-on: windows-latest steps: - - uses: compnerd/gha-setup-swift@main + - name: Setup + uses: compnerd/gha-setup-swift@v0.2.3 with: - branch: swift-5.7-release - tag: 5.7-RELEASE + branch: swift-5.10-release + tag: 5.10-RELEASE - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Test + run: swift test -c release --parallel --xunit-output .build/xUnit-output.xml + + - name: Upload artifacts + if: always() + uses: actions/upload-artifact@v4.4.3 + with: + name: artifacts-windows-${{ github.run_id }} + path: | + .build/**/*.a + .build/**/*.bundle + .build/**/*.dSYM + .build/**/*.gdb + .build/**/*.json + .build/**/*.txt + .build/**/*.xctest + .build/*.json + .build/*.txt + .build/*.xml + .build/*.yaml + if-no-files-found: warn + include-hidden-files: true - - name: Build Release - run: swift build -c release --verbose diff --git a/Tests/FirebladeMathTests/FunctionTests.swift b/Tests/FirebladeMathTests/FunctionTests.swift index efe1dd0..e97f905 100644 --- a/Tests/FirebladeMathTests/FunctionTests.swift +++ b/Tests/FirebladeMathTests/FunctionTests.swift @@ -162,12 +162,12 @@ final class FunctionTests: XCTestCase { XCTAssertEqual(FirebladeMath.normalize(SIMD3(1, 2, 3)), SIMD3(0.2672612419124244, 0.5345224838248488, 0.8017837257372732)) XCTAssertEqual(FirebladeMath.normalize(SIMD4(1, 2, 3, 4)), SIMD4(0.18257418583505536, 0.3651483716701107, 0.5477225575051661, 0.7302967433402214)) - XCTAssertEqual(FirebladeMath.normalize(SIMD2(1, 2)), SIMD2(0.4472136, 0.8944272)) - XCTAssertEqual(FirebladeMath.normalize(SIMD3(1, 2, 3)), SIMD3(0.26726124, 0.5345225, 0.8017837)) + XCTAssertEqualElements(FirebladeMath.normalize(SIMD2(1, 2)), SIMD2(0.4472136, 0.8944272), accuracy: 1e-7) + XCTAssertEqualElements(FirebladeMath.normalize(SIMD3(1, 2, 3)), SIMD3(0.26726124, 0.5345225, 0.8017837), accuracy: 1e-7) #if FRB_MATH_USE_SIMD - XCTAssertEqual(FirebladeMath.normalize(SIMD4(1, 2, 3, 4)), SIMD4(0.18257417, 0.36514834, 0.5477225, 0.7302967)) + XCTAssertEqualElements(FirebladeMath.normalize(SIMD4(1, 2, 3, 4)), SIMD4(0.18257417, 0.36514834, 0.5477225, 0.7302967), accuracy: 1e-7) #else - XCTAssertEqual(FirebladeMath.normalize(SIMD4(1, 2, 3, 4)), SIMD4(0.18257418, 0.36514837, 0.5477226, 0.73029673)) + XCTAssertEqualElements(FirebladeMath.normalize(SIMD4(1, 2, 3, 4)), SIMD4(0.18257418, 0.36514837, 0.5477226, 0.73029673), accuracy: 1e-7) #endif } func test_pow() { @@ -200,7 +200,7 @@ final class FunctionTests: XCTestCase { } func test_sin() { XCTAssertEqual(FirebladeMath.sin(Double(123)), -0.45990349068959124) - XCTAssertEqual(FirebladeMath.sin(Float(123)), -0.45990348) + XCTAssertEqual(FirebladeMath.sin(Float(123)), -0.45990348, accuracy: 1e-7) } func test_sinh() { XCTAssertEqual(FirebladeMath.sinh(Double(0.5)), 0.5210953054937474) diff --git a/renovate.json b/renovate.json index 39a2b6e..e6838fd 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,13 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:base" + "extends": ["config:base"], + "packageRules": [ + { + "description": "Accumulate non-major updates into one pull request", + "matchUpdateTypes": ["minor", "patch"], + "matchCurrentVersion": ">=1", + "groupName": "all non-major dependencies", + "groupSlug": "all-minor-patch" + } ] }