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
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.2-noble
26 steps:
27 - name: Checkout repository
28 uses: actions/checkout@v5
29 - name: Restore .build
30 id: "restore-build"
31 uses: actions/cache/restore@v4
32 with:
33 path: .build
34 key: "swiftpm-tests-build-${{ runner.os }}-${{ github.event.pull_request.base.sha || github.event.after }}"
35 restore-keys: "swiftpm-tests-build-${{ runner.os }}-"
36 - name: Building Package
37 run: swift build --build-tests
38 - name: Cache .build
39 if: steps.restore-build.outputs.cache-hit != 'true'
40 uses: actions/cache/save@v4
41 with:
42 path: .build
43 key: "swiftpm-tests-build-${{ runner.os }}-${{ github.event.pull_request.base.sha || github.event.after }}"
44 - name: Testing Package
45 run: swift test --skip-build
46
47 test-macos:
48 name: Testing and Fuzzing CBOR (macOS)
49 needs: swiftlint
50 runs-on: macos-latest
51 steps:
52 - name: Checkout repository
53 uses: actions/checkout@v5
54 - uses: swift-actions/setup-swift@next
55 with:
56 swift-version: "6.1"
57 - name: Restore .build
58 id: "restore-build"
59 uses: actions/cache/restore@v4
60 with:
61 path: .build
62 key: "swiftpm-tests-build-${{ runner.os }}-${{ github.event.pull_request.base.sha || github.event.after }}"
63 restore-keys: "swiftpm-tests-build-${{ runner.os }}-"
64 - name: Building Package
65 run: set -o pipefail && swift build --build-tests | xcbeautify --renderer github-actions
66# run: set -o pipefail && swift build --build-tests // --sanitize fuzzer | xcbeautify
67 - name: Cache .build
68 if: steps.restore-build.outputs.cache-hit != 'true'
69 uses: actions/cache/save@v4
70 with:
71 path: .build
72 key: "swiftpm-tests-build-${{ runner.os }}-${{ github.event.pull_request.base.sha || github.event.after }}"
73 - name: Testing Package
74 run: set -o pipefail && swift test --skip-build | xcbeautify --renderer github-actions
75# TODO: The Xcode version of the swift toolchain does not come with libfuzzer
76# What needs to happen is we install the open source toolchain and then we can fuzz here...
77# - name: Fuzzing For 15 Seconds
78# run: |
79# mkdir -p .fuzz
80# mkdir -p .fuzz/new-corpus
81# mkdir -p .fuzz/corpus
82# mkdir -p .fuzz/artifacts
83# ./.build/debug/Fuzzing .fuzz/new-corpus .fuzz/corpus -max_total_time=15 -artifact_prefix=.fuzz/artifacts -max_len=1000000
84# - name: "Upload Fuzzing Artifacts (if available)"
85# uses: actions/upload-artifact@v4
86# with:
87# name: "FuzzArtifacts"
88# path: ".fuzz/artifacts"
89# if-no-files-found: "ignore"
90# retention-days: 14