Skip to content

Instantly share code, notes, and snippets.

@VishwaiOSDev
Created February 18, 2023 15:11
Show Gist options
  • Save VishwaiOSDev/593e81946b72b3efc4d83f0cf6fa9509 to your computer and use it in GitHub Desktop.
Save VishwaiOSDev/593e81946b72b3efc4d83f0cf6fa9509 to your computer and use it in GitHub Desktop.
This GitHub Actions workflow is designed to build and test a Swift project when a pull request is opened or updated on the main branch.
name: test
on:
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Swift
uses: slashmo/install-swift@v0.4.0
with:
version: 5.6
- uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
.build/artifacts
.build/checkouts
.build/repositories
.build/workspace-state.json
key: test-spm-${{ runner.os }}-${{ hashFiles('Package.swift', 'Package.resolved') }}
- name: Build and Test
run: swift test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment