Skip to content

Commit

Permalink
Update project (#25)
Browse files Browse the repository at this point in the history
* Update renovate.json

* Update CI

* Shorter job workflow names

* Fix accuracy on macOS
  • Loading branch information
ctreffs authored Oct 21, 2024
1 parent cbc2734 commit be88b5b
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 93 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
49 changes: 0 additions & 49 deletions .github/workflows/ci-macos-11.yml

This file was deleted.

46 changes: 22 additions & 24 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

36 changes: 29 additions & 7 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions Tests/FirebladeMathTests/FunctionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,12 @@ final class FunctionTests: XCTestCase {
XCTAssertEqual(FirebladeMath.normalize(SIMD3<Double>(1, 2, 3)), SIMD3<Double>(0.2672612419124244, 0.5345224838248488, 0.8017837257372732))
XCTAssertEqual(FirebladeMath.normalize(SIMD4<Double>(1, 2, 3, 4)), SIMD4<Double>(0.18257418583505536, 0.3651483716701107, 0.5477225575051661, 0.7302967433402214))

XCTAssertEqual(FirebladeMath.normalize(SIMD2<Float>(1, 2)), SIMD2<Float>(0.4472136, 0.8944272))
XCTAssertEqual(FirebladeMath.normalize(SIMD3<Float>(1, 2, 3)), SIMD3<Float>(0.26726124, 0.5345225, 0.8017837))
XCTAssertEqualElements(FirebladeMath.normalize(SIMD2<Float>(1, 2)), SIMD2<Float>(0.4472136, 0.8944272), accuracy: 1e-7)
XCTAssertEqualElements(FirebladeMath.normalize(SIMD3<Float>(1, 2, 3)), SIMD3<Float>(0.26726124, 0.5345225, 0.8017837), accuracy: 1e-7)
#if FRB_MATH_USE_SIMD
XCTAssertEqual(FirebladeMath.normalize(SIMD4<Float>(1, 2, 3, 4)), SIMD4<Float>(0.18257417, 0.36514834, 0.5477225, 0.7302967))
XCTAssertEqualElements(FirebladeMath.normalize(SIMD4<Float>(1, 2, 3, 4)), SIMD4<Float>(0.18257417, 0.36514834, 0.5477225, 0.7302967), accuracy: 1e-7)
#else
XCTAssertEqual(FirebladeMath.normalize(SIMD4<Float>(1, 2, 3, 4)), SIMD4<Float>(0.18257418, 0.36514837, 0.5477226, 0.73029673))
XCTAssertEqualElements(FirebladeMath.normalize(SIMD4<Float>(1, 2, 3, 4)), SIMD4<Float>(0.18257418, 0.36514837, 0.5477226, 0.73029673), accuracy: 1e-7)
#endif
}
func test_pow() {
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 9 additions & 2 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}

0 comments on commit be88b5b

Please sign in to comment.