Skip to content

Commit be88b5b

Browse files
authored
Update project (#25)
* Update renovate.json * Update CI * Shorter job workflow names * Fix accuracy on macOS
1 parent cbc2734 commit be88b5b

File tree

6 files changed

+90
-93
lines changed

6 files changed

+90
-93
lines changed

.github/workflows/ci-linux.yml

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,36 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
linux-test-build-release:
11+
linux:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
swift: ["5.1", "latest"]
15+
swift: ["latest"]
1616
container:
1717
image: swift:${{ matrix.swift }}
1818
steps:
1919
- name: Checkout
20-
uses: actions/[email protected]
20+
uses: actions/checkout@v4
21+
2122
- name: Test
22-
run: swift test -c release --skip-update --parallel --enable-code-coverage
23-
- name: Build Release
24-
run: swift build -c release
23+
run: swift test -c release --enable-xctest --parallel --xunit-output .build/xUnit-output.xml
24+
25+
- name: Upload artifacts
26+
if: always()
27+
uses: actions/upload-artifact@v4
28+
with:
29+
name: artifacts-linux-${{ matrix.swift }}-${{ github.run_id }}
30+
path: |
31+
.build/**/*.a
32+
.build/**/*.bundle
33+
.build/**/*.dSYM
34+
.build/**/*.gdb
35+
.build/**/*.json
36+
.build/**/*.txt
37+
.build/**/*.xctest
38+
.build/*.json
39+
.build/*.txt
40+
.build/*.xml
41+
.build/*.yaml
42+
if-no-files-found: warn
43+
include-hidden-files: true

.github/workflows/ci-macos-11.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.github/workflows/ci-macos.yml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,40 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
macos-test-build-release-xcode:
11+
macos-xcode:
1212
runs-on: macos-latest
1313
strategy:
1414
matrix:
15-
xcode: [13.4.1, 14.1]
15+
xcode: ["14.3.1", "15.4", "16.0"]
1616
steps:
1717
- name: Checkout
18-
uses: actions/[email protected]
18+
uses: actions/checkout@v4
19+
1920
- name: Select Xcode ${{ matrix.xcode }}
2021
run: sudo xcode-select -s '/Applications/Xcode_${{ matrix.xcode }}.app'
22+
2123
- name: Test
22-
run: make test
24+
run: swift test -c release --parallel --xunit-output .build/xUnit-output.xml
2325
env:
2426
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
25-
- name: Upload test artifacts
26-
if: failure()
27-
uses: actions/[email protected]
27+
28+
- name: Upload artifacts
29+
if: always()
30+
uses: actions/[email protected]
2831
with:
29-
name: test-artifacts-${{ matrix.xcode }}-${{ github.run_id }}
32+
name: artifacts-macOS-${{ matrix.xcode }}-${{ github.run_id }}
3033
path: |
34+
.build/**/*.a
35+
.build/**/*.bundle
36+
.build/**/*.dSYM
37+
.build/**/*.gdb
3138
.build/**/*.json
39+
.build/**/*.txt
3240
.build/**/*.xctest
33-
- name: Build Release
34-
run: make buildRelease
35-
env:
36-
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
37-
- name: Upload build artifacts
38-
if: failure()
39-
uses: actions/[email protected]
40-
with:
41-
name: build-artifacts-${{ matrix.xcode }}-${{ github.run_id }}
42-
path: |
43-
*.lcov
41+
.build/*.json
42+
.build/*.txt
43+
.build/*.xml
4444
.build/*.yaml
45-
.build/**/*.a
46-
.build/**/*.so
47-
.build/**/*.dylib
48-
.build/**/*.dSYM
49-
.build/**/*.json
45+
if-no-files-found: warn
46+
include-hidden-files: true
47+

.github/workflows/ci-windows.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,38 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
windows-test-build-release:
11+
windows:
1212
runs-on: windows-latest
1313
steps:
14-
- uses: compnerd/gha-setup-swift@main
14+
- name: Setup
15+
uses: compnerd/[email protected]
1516
with:
16-
branch: swift-5.7-release
17-
tag: 5.7-RELEASE
17+
branch: swift-5.10-release
18+
tag: 5.10-RELEASE
1819

1920
- name: Checkout
20-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
22+
23+
- name: Test
24+
run: swift test -c release --parallel --xunit-output .build/xUnit-output.xml
25+
26+
- name: Upload artifacts
27+
if: always()
28+
uses: actions/[email protected]
29+
with:
30+
name: artifacts-windows-${{ github.run_id }}
31+
path: |
32+
.build/**/*.a
33+
.build/**/*.bundle
34+
.build/**/*.dSYM
35+
.build/**/*.gdb
36+
.build/**/*.json
37+
.build/**/*.txt
38+
.build/**/*.xctest
39+
.build/*.json
40+
.build/*.txt
41+
.build/*.xml
42+
.build/*.yaml
43+
if-no-files-found: warn
44+
include-hidden-files: true
2145

22-
- name: Build Release
23-
run: swift build -c release --verbose

Tests/FirebladeMathTests/FunctionTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ final class FunctionTests: XCTestCase {
162162
XCTAssertEqual(FirebladeMath.normalize(SIMD3<Double>(1, 2, 3)), SIMD3<Double>(0.2672612419124244, 0.5345224838248488, 0.8017837257372732))
163163
XCTAssertEqual(FirebladeMath.normalize(SIMD4<Double>(1, 2, 3, 4)), SIMD4<Double>(0.18257418583505536, 0.3651483716701107, 0.5477225575051661, 0.7302967433402214))
164164

165-
XCTAssertEqual(FirebladeMath.normalize(SIMD2<Float>(1, 2)), SIMD2<Float>(0.4472136, 0.8944272))
166-
XCTAssertEqual(FirebladeMath.normalize(SIMD3<Float>(1, 2, 3)), SIMD3<Float>(0.26726124, 0.5345225, 0.8017837))
165+
XCTAssertEqualElements(FirebladeMath.normalize(SIMD2<Float>(1, 2)), SIMD2<Float>(0.4472136, 0.8944272), accuracy: 1e-7)
166+
XCTAssertEqualElements(FirebladeMath.normalize(SIMD3<Float>(1, 2, 3)), SIMD3<Float>(0.26726124, 0.5345225, 0.8017837), accuracy: 1e-7)
167167
#if FRB_MATH_USE_SIMD
168-
XCTAssertEqual(FirebladeMath.normalize(SIMD4<Float>(1, 2, 3, 4)), SIMD4<Float>(0.18257417, 0.36514834, 0.5477225, 0.7302967))
168+
XCTAssertEqualElements(FirebladeMath.normalize(SIMD4<Float>(1, 2, 3, 4)), SIMD4<Float>(0.18257417, 0.36514834, 0.5477225, 0.7302967), accuracy: 1e-7)
169169
#else
170-
XCTAssertEqual(FirebladeMath.normalize(SIMD4<Float>(1, 2, 3, 4)), SIMD4<Float>(0.18257418, 0.36514837, 0.5477226, 0.73029673))
170+
XCTAssertEqualElements(FirebladeMath.normalize(SIMD4<Float>(1, 2, 3, 4)), SIMD4<Float>(0.18257418, 0.36514837, 0.5477226, 0.73029673), accuracy: 1e-7)
171171
#endif
172172
}
173173
func test_pow() {
@@ -200,7 +200,7 @@ final class FunctionTests: XCTestCase {
200200
}
201201
func test_sin() {
202202
XCTAssertEqual(FirebladeMath.sin(Double(123)), -0.45990349068959124)
203-
XCTAssertEqual(FirebladeMath.sin(Float(123)), -0.45990348)
203+
XCTAssertEqual(FirebladeMath.sin(Float(123)), -0.45990348, accuracy: 1e-7)
204204
}
205205
func test_sinh() {
206206
XCTAssertEqual(FirebladeMath.sinh(Double(0.5)), 0.5210953054937474)

renovate.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [
4-
"config:base"
3+
"extends": ["config:base"],
4+
"packageRules": [
5+
{
6+
"description": "Accumulate non-major updates into one pull request",
7+
"matchUpdateTypes": ["minor", "patch"],
8+
"matchCurrentVersion": ">=1",
9+
"groupName": "all non-major dependencies",
10+
"groupSlug": "all-minor-patch"
11+
}
512
]
613
}

0 commit comments

Comments
 (0)