A fast, safe, and efficient CBOR serialization library for Swift on any platform. swiftpackageindex.com/thecoolwinter/CBOR/1.1.1/documentation/cbor
atproto swift cbor
at dag-cbor 93 lines 3.3 kB view raw
1name: CI 2on: 3 pull_request: 4 branches: 5 - 'main' 6 workflow_dispatch: 7 push: 8 branches: 9 - 'main' 10jobs: 11 swiftlint: 12 runs-on: macos-latest 13 steps: 14 - name: Checkout repository 15 uses: actions/checkout@v5 16 - name: Lint Package 17 uses: cirruslabs/swiftlint-action@v1 18 with: 19 version: latest 20 21 test-linux: 22 name: Testing CBOR (ubuntu) 23 needs: swiftlint 24 runs-on: ubuntu-latest 25 container: swift:6.0-noble 26 steps: 27 - name: Checkout repository 28 uses: actions/checkout@v5 29 - uses: swift-actions/setup-swift@next 30 with: 31 swift-version: "6.0" 32 - name: Restore .build 33 id: "restore-build" 34 uses: actions/cache/restore@v4 35 with: 36 path: .build 37 key: "swiftpm-tests-build-${{ runner.os }}-${{ github.event.pull_request.base.sha || github.event.after }}" 38 restore-keys: "swiftpm-tests-build-${{ runner.os }}-" 39 - name: Building Package 40 run: swift build --build-tests 41 - name: Cache .build 42 if: steps.restore-build.outputs.cache-hit != 'true' 43 uses: actions/cache/save@v4 44 with: 45 path: .build 46 key: "swiftpm-tests-build-${{ runner.os }}-${{ github.event.pull_request.base.sha || github.event.after }}" 47 - name: Testing Package 48 run: swift test --skip-build 49 50 test-macos: 51 name: Testing and Fuzzing CBOR (macOS) 52 needs: swiftlint 53 runs-on: macos-latest 54 steps: 55 - name: Checkout repository 56 uses: actions/checkout@v5 57 - uses: swift-actions/setup-swift@next 58 with: 59 swift-version: "6.0" 60 - name: Restore .build 61 id: "restore-build" 62 uses: actions/cache/restore@v4 63 with: 64 path: .build 65 key: "swiftpm-tests-build-${{ runner.os }}-${{ github.event.pull_request.base.sha || github.event.after }}" 66 restore-keys: "swiftpm-tests-build-${{ runner.os }}-" 67 - name: Building Package 68 run: set -o pipefail && swift build --build-tests | xcbeautify 69# run: set -o pipefail && swift build --build-tests // --sanitize fuzzer | xcbeautify 70 - name: Cache .build 71 if: steps.restore-build.outputs.cache-hit != 'true' 72 uses: actions/cache/save@v4 73 with: 74 path: .build 75 key: "swiftpm-tests-build-${{ runner.os }}-${{ github.event.pull_request.base.sha || github.event.after }}" 76 - name: Testing Package 77 run: set -o pipefail && swift test --skip-build | xcbeautify 78# TODO: The Xcode version of the swift toolchain does not come with libfuzzer 79# What needs to happen is we install the open source toolchain and then we can fuzz here... 80# - name: Fuzzing For 15 Seconds 81# run: | 82# mkdir -p .fuzz 83# mkdir -p .fuzz/new-corpus 84# mkdir -p .fuzz/corpus 85# mkdir -p .fuzz/artifacts 86# ./.build/debug/Fuzzing .fuzz/new-corpus .fuzz/corpus -max_total_time=15 -artifact_prefix=.fuzz/artifacts -max_len=1000000 87# - name: "Upload Fuzzing Artifacts (if available)" 88# uses: actions/upload-artifact@v4 89# with: 90# name: "FuzzArtifacts" 91# path: ".fuzz/artifacts" 92# if-no-files-found: "ignore" 93# retention-days: 14