Skip to content

Commit

Permalink
ci: add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
izik1 committed Apr 19, 2023
1 parent 2fe8046 commit 80c5f6a
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/swift-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Swift CI
on:
pull_request:
push:
branches: ['main']

jobs:
format:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Install swift-format
run: brew install swift-format
- name: Format
run: swift format lint --strict --configuration .swift-format.json --recursive --parallel Sources/ Tests/ Examples/ Package.swift

build:
strategy:
matrix:
swift: ["5.7"]
runs-on: macos-11
steps:
- uses: swift-actions/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}

- uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: sdk/swift/.build
key: ${{ runner.os }}-${{ matrix.swift }}-spm-${{ github.job }}-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ matrix.swift }}-spm-
- name: Build
run: swift build

test:
strategy:
matrix:
swift: ["5.7"]
needs: [build]
runs-on: macos-11
steps:
- uses: swift-actions/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}
- uses: actions/checkout@v3

- uses: actions/cache@v3
with:
path: sdk/swift/.build
key: ${{ runner.os }}-${{ matrix.swift }}-spm-${{ github.job }}-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ matrix.swift }}-spm-
- name: Test
run: swift test

0 comments on commit 80c5f6a

Please sign in to comment.