How can I run swiftlint on GitHub Actions for linux?

873 Views Asked by At

Since GitHub mac actions are slow and expensive, how can I run swiftlint under a linux environment in an action?

1

There are 1 best solutions below

0
On

The easiest way is to use the official swiftlint docker image as the container for the action:

name: SwiftLint
on:
  workflow_dispatch:
  pull_request:
jobs:
  build:
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/realm/swiftlint:5.5-latest

    steps:
    - uses: actions/checkout@v1
      with:
        fetch-depth: 1

    - name: SwiftLint
      run: |
        swiftlint --reporter github-actions-logging --strict