Skip to content

Commit

Permalink
support padding characters in base32 (#32)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
adam-fowler authored May 13, 2024
1 parent 97237cf commit 188c596
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 130 deletions.
75 changes: 25 additions & 50 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install swiftformat
run: brew install swiftformat
- name: Run validity
Expand All @@ -25,24 +25,21 @@ jobs:
fail-fast: false
matrix:
images:
- swift:5.1
- swift:5.2
- swift:5.3
- swiftlang/swift:nightly-master
- swift:5.8
- swift:5.9
- swift:5.10
- swiftlang/swift:nightly-jammy
container:
image: ${{ matrix.images }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Test
run: swift test --enable-code-coverage --enable-test-discovery
run: swift test --enable-code-coverage
- name: Convert coverage files
run: llvm-cov export -format="lcov" .build/debug/swift-extras-base64PackageTests.xctest -instr-profile .build/debug/codecov/default.profdata > info.lcov
- name: Install curl
if: matrix.images != 'swiftlang/swift:nightly-amazonlinux2'
run: apt-get update && apt-get install -y curl # required by the codecov action.
- name: Upload to codecov.io
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
file: info.lcov

Expand All @@ -52,15 +49,12 @@ jobs:
fail-fast: false
matrix:
images:
- swift:5.1
- swift:5.2
- swift:5.3
- swiftlang/swift:nightly-master
- swift:5.10
container:
image: ${{ matrix.images }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Build & run
run: swift run -c release

Expand All @@ -70,62 +64,43 @@ jobs:
fail-fast: false
matrix:
images:
- swift:5.3
- swiftlang/swift:nightly-master
- swift:5.10
container:
image: ${{ matrix.images }}
env:
MAX_ALLOCS_ALLOWED_base64_decoding: 1000
MAX_ALLOCS_ALLOWED_base64_encoding: 1000
MAX_ALLOCS_ALLOWED_base32_decoding: 1000
MAX_ALLOCS_ALLOWED_base32_encoding: 1000
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Test
run: ./run-tests.sh
working-directory: ./IntegrationTests

"macOS-Tests":
runs-on: macOS-latest
runs-on: macOS-14
strategy:
fail-fast: false
matrix:
xcode:
- Xcode_11.2.app
- Xcode_11.6.app
- Xcode_12.2.app
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Show all Xcode versions
run: ls -an /Applications/ | grep Xcode*
- name: Change Xcode command line tools
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}/Contents/Developer
- name: SPM Build
run: swift build
uses: actions/checkout@v4
- name: SPM Tests
run: swift test --parallel -Xswiftc -DDEBUG
- name: Xcode Tests
run: |
swift package generate-xcodeproj
xcodebuild -quiet -parallel-testing-enabled YES -scheme swift-extras-base64-Package -enableCodeCoverage YES build test
- name: Codecov
run: bash <(curl -s https://codecov.io/bash) -t ${{secrets.CODECOV_TOKEN}} -f *.coverage.txt
run: swift test --parallel --enable-code-coverage -Xswiftc -DDEBUG
- name: Convert coverage files
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
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
file: info.lcov

"macOS-Performance-Tests":
runs-on: macOS-latest
runs-on: macOS-13
strategy:
fail-fast: false
matrix:
xcode:
- Xcode_11.2.app
- Xcode_11.6.app
- Xcode_12.2.app
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Change Xcode command line tools
run: sudo xcode-select -s /Applications/${{ matrix.xcode }}/Contents/Developer
- name: Swift version
run: swift --version
uses: actions/checkout@v4
- name: Build & run
run: swift run -c release
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.build
/*.xcodeproj
xcuserdata
/.swiftpm
/.swiftpm
.vscode
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.1
// swift-tools-version:5.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand Down
Loading

0 comments on commit 188c596

Please sign in to comment.