From 1a7b1187911d611bae165773882068fc78cc0602 Mon Sep 17 00:00:00 2001 From: Gustaf Rosenblad Date: Wed, 10 Sep 2025 19:18:32 +0200 Subject: [PATCH] Added GitHub actions for build and test --- .github/workflows/ci.yml | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6594879 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-15, ubuntu-latest] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Swift + uses: swift-actions/setup-swift@v2 + with: + swift-version: "6.1" + + - name: Cache SPM + uses: actions/cache@v4 + with: + path: | + .build + ~/.cache/org.swift.swiftpm + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-spm- + + - name: Build + run: swift build + + test: + name: Test + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-15, ubuntu-latest] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Swift + uses: swift-actions/setup-swift@v2 + with: + swift-version: "6.1" + + - name: Cache SPM + uses: actions/cache@v4 + with: + path: | + .build + ~/.cache/org.swift.swiftpm + key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }} + restore-keys: | + ${{ runner.os }}-spm- + + - name: Run tests + run: swift test