From dc4f25d6b5f8e7de3ca30fec8a934ff3632927d3 Mon Sep 17 00:00:00 2001 From: Juri Pakaste Date: Sat, 11 May 2024 16:58:18 +0300 Subject: [PATCH] Add GitHub workflows --- .github/workflows/build.yml | 27 +++++++++++++++++++++++++++ .github/workflows/swiftformat.yml | 25 +++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/swiftformat.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..96f5435 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,27 @@ +name: build + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Set up Swift + uses: swift-actions/setup-swift@v2 + with: + swift-version: "5.10" + + - name: Checkout + uses: actions/checkout@v3 + + - name: Build + run: swift build + + - name: Run tests + run: swift test diff --git a/.github/workflows/swiftformat.yml b/.github/workflows/swiftformat.yml new file mode 100644 index 0000000..8398cf2 --- /dev/null +++ b/.github/workflows/swiftformat.yml @@ -0,0 +1,25 @@ +name: SwiftFormat + +on: + pull_request: + paths: + - '.github/workflows/swiftformat.yml' + - '.swiftformat' + - '**/*.swift' + +jobs: + SwiftFormat: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Swift + uses: swift-actions/setup-swift@v2.0.0 + with: + swift-version: "5.10" + + - name: Set up Mint + uses: irgaly/setup-mint@v1.4.0 + + - name: Run SwiftFormat with Mint + run: mint run swiftformat . --lint