Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@ on:
package_path:
type: string
required: false
default: ''
default: './'
description: "Specifies a subpath of the checkout that the package is contained in."

jobs:
format:
name: Format linting
runs-on: ubuntu-latest
container: swift:latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Pull formatting docker image
run: docker pull ghcr.io/nicklockwood/swiftformat:latest
- name: Run format linting
run: docker run --rm -v ${{ github.workspace }}:/repo ghcr.io/nicklockwood/swiftformat:latest /repo/${{ inputs.package_path }} --lint
- name: Checkout
uses: actions/checkout@v4
- name: Format
run: |
swift format lint \
--parallel \
--recursive \
${{ inputs.package_path != './' && inputs.package_path || './' }}
7 changes: 7 additions & 0 deletions WorkflowTestPackage/.swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"version": 1,
"indentation" : {
"spaces" : 4
},
"lineBreakBeforeEachArgument": true
}
2 changes: 1 addition & 1 deletion WorkflowTestPackage/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let package = Package(
.library(
name: "WorkflowTestPackage",
targets: ["WorkflowTestPackage"]
),
)
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@testable import WorkflowTestPackage
import XCTest

@testable import WorkflowTestPackage

class WorkflowTestPackageTests: XCTestCase {
func testHello() {
XCTAssertEqual(WorkflowTest().hello(), "world")
Expand Down
Loading