From fcf58e9594b94988a1c14f57f80f2c61e82b90ce Mon Sep 17 00:00:00 2001 From: Krystof Date: Wed, 15 May 2024 19:44:11 +0200 Subject: [PATCH] chore(CI): swift CI --- .github/workflows/app-ci.yaml | 18 ++++++++ .../{backend.yaml => backend-ci.yaml} | 9 ++-- .github/workflows/check-format.yaml | 42 +++++++++++++++++++ .github/workflows/{ci.yml => docs-ci.yml} | 15 +++---- 4 files changed, 71 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/app-ci.yaml rename .github/workflows/{backend.yaml => backend-ci.yaml} (90%) create mode 100644 .github/workflows/check-format.yaml rename .github/workflows/{ci.yml => docs-ci.yml} (71%) diff --git a/.github/workflows/app-ci.yaml b/.github/workflows/app-ci.yaml new file mode 100644 index 00000000..93c1159a --- /dev/null +++ b/.github/workflows/app-ci.yaml @@ -0,0 +1,18 @@ +name: App CI + +on: push + +jobs: + ci: + name: App CI 🚀 + runs-on: macos-latest + steps: + - uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf + with: + swift-version: 5.10 + - uses: actions/checkout@v4 + + - name: Unit tests + run: | + cd ./app/metro-now + xcodebuild test -scheme metro-now -project metro-now.xcodeproj -destination 'platform=iOS Simulator,name=iPhone 15,OS=17.5' | xcpretty && exit ${PIPESTATUS[0]} diff --git a/.github/workflows/backend.yaml b/.github/workflows/backend-ci.yaml similarity index 90% rename from .github/workflows/backend.yaml rename to .github/workflows/backend-ci.yaml index 07f1146a..c1a5b028 100644 --- a/.github/workflows/backend.yaml +++ b/.github/workflows/backend-ci.yaml @@ -1,10 +1,10 @@ -name: Backend +name: Backend CI on: push jobs: - backend-ci: - name: CI + build: + name: Build 🏗️ strategy: matrix: os: [ubuntu-latest, macos-latest] @@ -20,7 +20,8 @@ jobs: bun run build publish-docker-image: - needs: backend-ci + name: Publish Docker image 🚀 + needs: build runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' diff --git a/.github/workflows/check-format.yaml b/.github/workflows/check-format.yaml new file mode 100644 index 00000000..aeb5b26e --- /dev/null +++ b/.github/workflows/check-format.yaml @@ -0,0 +1,42 @@ +name: Check format + +on: push + +jobs: + swift-format-check: + name: Swift format check 💅 + runs-on: macos-latest + + steps: + - uses: swift-actions/setup-swift@65540b95f51493d65f5e59e97dcef9629ddf11bf + with: + swift-version: 5.10 + - uses: actions/checkout@v4 + + - name: Check Swift format + run: swiftformat . --lint + + js-format-check: + name: JS format check 💅 + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Check format + run: | + pnpm install + pnpm run check:format diff --git a/.github/workflows/ci.yml b/.github/workflows/docs-ci.yml similarity index 71% rename from .github/workflows/ci.yml rename to .github/workflows/docs-ci.yml index bde2d4f1..2f6d8e07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/docs-ci.yml @@ -1,9 +1,10 @@ -name: CI +name: Docs CI on: push jobs: - frontend-ci: + docs-ci: + name: Docs CI 📖 runs-on: ubuntu-latest steps: @@ -18,18 +19,14 @@ jobs: with: version: 8 - - name: Check format - run: | - pnpm install - pnpm run check:format - - - name: Frontend lint + - name: Lint 🔍 + continue-on-error: true run: | cd ./frontend pnpm install pnpm run lint - - name: Frontend build + - name: Build 👷‍♂️ run: | cd ./frontend pnpm install