Skip to content

Commit 188c596

Browse files
authored
support padding characters in base32 (#32)
* Support Base32 with padding * Optimize Base32._encode * Add .vscode to .gitignore * Swift format, Update CI * Correct buffer size * Calculate padding size correctly * Update CI Get rid of Xcode build tests and just use SwiftPM, reduce number of tests as many are unnecessary * Update CI Integration tests * Dunno what is going on with Integration tests * Update code-coverage * Delete LinuxMain.swift * xcrun llvm-cov * Fix typo in macOS CI * Use macOS-14
1 parent 97237cf commit 188c596

File tree

8 files changed

+178
-130
lines changed

8 files changed

+178
-130
lines changed

.github/workflows/ci.yaml

Lines changed: 25 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: macOS-latest
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
1717
- name: Install swiftformat
1818
run: brew install swiftformat
1919
- name: Run validity
@@ -25,24 +25,21 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
images:
28-
- swift:5.1
29-
- swift:5.2
30-
- swift:5.3
31-
- swiftlang/swift:nightly-master
28+
- swift:5.8
29+
- swift:5.9
30+
- swift:5.10
31+
- swiftlang/swift:nightly-jammy
3232
container:
3333
image: ${{ matrix.images }}
3434
steps:
3535
- name: Checkout
36-
uses: actions/checkout@v2
36+
uses: actions/checkout@v4
3737
- name: Test
38-
run: swift test --enable-code-coverage --enable-test-discovery
38+
run: swift test --enable-code-coverage
3939
- name: Convert coverage files
4040
run: llvm-cov export -format="lcov" .build/debug/swift-extras-base64PackageTests.xctest -instr-profile .build/debug/codecov/default.profdata > info.lcov
41-
- name: Install curl
42-
if: matrix.images != 'swiftlang/swift:nightly-amazonlinux2'
43-
run: apt-get update && apt-get install -y curl # required by the codecov action.
4441
- name: Upload to codecov.io
45-
uses: codecov/codecov-action@v1
42+
uses: codecov/codecov-action@v4
4643
with:
4744
file: info.lcov
4845

@@ -52,15 +49,12 @@ jobs:
5249
fail-fast: false
5350
matrix:
5451
images:
55-
- swift:5.1
56-
- swift:5.2
57-
- swift:5.3
58-
- swiftlang/swift:nightly-master
52+
- swift:5.10
5953
container:
6054
image: ${{ matrix.images }}
6155
steps:
6256
- name: Checkout
63-
uses: actions/checkout@v2
57+
uses: actions/checkout@v4
6458
- name: Build & run
6559
run: swift run -c release
6660

@@ -70,62 +64,43 @@ jobs:
7064
fail-fast: false
7165
matrix:
7266
images:
73-
- swift:5.3
74-
- swiftlang/swift:nightly-master
67+
- swift:5.10
7568
container:
7669
image: ${{ matrix.images }}
7770
env:
7871
MAX_ALLOCS_ALLOWED_base64_decoding: 1000
7972
MAX_ALLOCS_ALLOWED_base64_encoding: 1000
73+
MAX_ALLOCS_ALLOWED_base32_decoding: 1000
74+
MAX_ALLOCS_ALLOWED_base32_encoding: 1000
8075
steps:
8176
- name: Checkout
82-
uses: actions/checkout@v2
77+
uses: actions/checkout@v4
8378
- name: Test
8479
run: ./run-tests.sh
8580
working-directory: ./IntegrationTests
8681

8782
"macOS-Tests":
88-
runs-on: macOS-latest
83+
runs-on: macOS-14
8984
strategy:
9085
fail-fast: false
91-
matrix:
92-
xcode:
93-
- Xcode_11.2.app
94-
- Xcode_11.6.app
95-
- Xcode_12.2.app
9686
steps:
9787
- name: Checkout
98-
uses: actions/checkout@v2
99-
- name: Show all Xcode versions
100-
run: ls -an /Applications/ | grep Xcode*
101-
- name: Change Xcode command line tools
102-
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}/Contents/Developer
103-
- name: SPM Build
104-
run: swift build
88+
uses: actions/checkout@v4
10589
- name: SPM Tests
106-
run: swift test --parallel -Xswiftc -DDEBUG
107-
- name: Xcode Tests
108-
run: |
109-
swift package generate-xcodeproj
110-
xcodebuild -quiet -parallel-testing-enabled YES -scheme swift-extras-base64-Package -enableCodeCoverage YES build test
111-
- name: Codecov
112-
run: bash <(curl -s https://codecov.io/bash) -t ${{secrets.CODECOV_TOKEN}} -f *.coverage.txt
90+
run: swift test --parallel --enable-code-coverage -Xswiftc -DDEBUG
91+
- name: Convert coverage files
92+
run: xcrun llvm-cov export -format="lcov" .build/debug/swift-extras-base64PackageTests.xctest/Contents/MacOS/swift-extras-base64PackageTests -instr-profile .build/debug/codecov/default.profdata > info.lcov
93+
- name: Upload to codecov.io
94+
uses: codecov/codecov-action@v4
95+
with:
96+
file: info.lcov
11397

11498
"macOS-Performance-Tests":
115-
runs-on: macOS-latest
99+
runs-on: macOS-13
116100
strategy:
117101
fail-fast: false
118-
matrix:
119-
xcode:
120-
- Xcode_11.2.app
121-
- Xcode_11.6.app
122-
- Xcode_12.2.app
123102
steps:
124103
- name: Checkout
125-
uses: actions/checkout@v2
126-
- name: Change Xcode command line tools
127-
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}/Contents/Developer
128-
- name: Swift version
129-
run: swift --version
104+
uses: actions/checkout@v4
130105
- name: Build & run
131106
run: swift run -c release

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
.build
33
/*.xcodeproj
44
xcuserdata
5-
/.swiftpm
5+
/.swiftpm
6+
.vscode

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.1
1+
// swift-tools-version:5.3
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription

0 commit comments

Comments
 (0)