Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support running on macos runners #41

Open
BrentMifsud opened this issue Feb 18, 2022 · 4 comments
Open

Support running on macos runners #41

BrentMifsud opened this issue Feb 18, 2022 · 4 comments

Comments

@BrentMifsud
Copy link

Title is pretty self explanatory.

We have our own macos build machine that we hooked up to be a runner (so we dont have to pay for github actions).

It would be nice to be able to run this workflow on a mac machine.

@grzegorzkrukowski
Copy link

+1 - I would love to use it on macOS as well

@landsman
Copy link

yes please!

@ladislas
Copy link

I have the same request. In the meantime this little workflow gets the job done by running swiftlint only on changed files on our self hosted macOS runner.

name: Linter - SwiftLint

on:
  pull_request:
    types: [opened, synchronize, reopened]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  swift_format:
    name: lint
    runs-on: [self-hosted, iOS]

    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0 # Fetch all history for all branches and tags

      - name: Run swiftlint
        run: |
          echo ""
          echo "🏃‍♂️ Running swiftlint on modified files 🤵‍♂️"

          git diff --name-status origin/main          \
            | grep -E "^A|^M" | sed "s/^[AM]\t//g"    \
            | grep -E "\.swift\$$"                    \
            || echo "No files added nor modified!"

          git diff --name-status origin/main          \
            | grep -E "^A|^M" | sed "s/^[AM]\t//g"    \
            | grep -E "\.swift\$$"                    \
            | xargs --no-run-if-empty swiftlint lint --quiet --strict --reporter github-actions-logging

@fkorotkov
Copy link

Everyone interested, please checkout "SwiftLint Annotations" Action which doesn't use Docker and natively runs swiftlint binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants