Add keyboard layout caching and limit Carbon TIS calls to main thread #32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables | |
| # https://github.com/peripheryapp/periphery/blob/master/.github/workflows/test.yml | |
| name: Lint & Test | |
| on: | |
| push: { branches: [ main ] } | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| skip: | |
| name: Pre-Check & Skip | |
| continue-on-error: true | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_skip: ${{ steps.check.outputs.should_skip }} | |
| steps: | |
| - name: Skip duplicate actions | |
| id: check | |
| uses: fkirc/skip-duplicate-actions@v5 | |
| main: | |
| name: Lint & Test | |
| needs: skip | |
| if: needs.skip.outputs.should_skip != 'true' | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout Git | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| # ⚙️ Tools | |
| - name: Install Homebrew | |
| uses: tecolicom/actions-use-homebrew-tools@v1 | |
| with: | |
| tools: xcbeautify swiftlint | |
| cache: yes | |
| # 📦 Cache | |
| - name: Cache SPM | |
| id: cache-spm | |
| uses: actions/cache@v4 | |
| with: | |
| path: .build | |
| key: ${{ runner.os }}-spm-${{ hashFiles('Package.swift', 'Package.resolved') }} | |
| restore-keys: ${{ runner.os }}-spm- | |
| # 💅 Lint | |
| - name: Run SwiftLint | |
| run: swiftlint lint --quiet --strict # --reporter github-actions-logging | |
| # 🧪 Resolve, Build, Test SPM | |
| - name: Resolve SPM | |
| if: steps.cache-spm.outputs.cache-hit != 'true' | |
| run: swift package resolve | |
| - name: Build SPM | |
| run: swift build --build-tests | |
| - name: Test SPM | |
| run: swift test 2>&1 | xcbeautify |