Skip to content
code

GitHub Action

GitHub Actions for Swift

v1.0.1 Latest version

GitHub Actions for Swift

code

GitHub Actions for Swift

Additional Swift supports on GitHub Actions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: GitHub Actions for Swift

uses: sinoru/actions-swift@v1.0.1

Learn more about this action in sinoru/actions-swift

Choose a version

GitHub Action for Swift

This action executes Swift and generates github action annotations from swift warnings/errors.

Usage

An example to executing Swift follows:

name: Swift

on:
  push:
    paths:
      - '.github/workflows/swift.yml' # File path to this yaml
      - '**/*.swift'
  pull_request:
    paths:
      - '.github/workflows/swift.yml' # File path to this yaml
      - '**/*.swift'

jobs:
  swift-on-docker:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: sinoru/actions-swift@v1
        with:
          swift-image-tag: 'latest'
          args: 'build'
      - uses: sinoru/actions-swift@v1
        with:
          swift-image-tag: 'latest'
          args: 'test'

  swift-without-docker:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: sinoru/actions-swift@v1
        with:
          swift-version: '5.6.3'
          args: 'build'
      - uses: sinoru/actions-swift@v1
        with:
          args: 'test'