Skip to content

Commit bbda8a2

Browse files
authored
Create swift.yml
CI/CD Action added.
1 parent 1411ad7 commit bbda8a2

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/swift.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This workflow will build a Swift project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift
3+
4+
# This is a GitHub Actions workflow file for building a Swift project.
5+
name: Swift # Name of the workflow
6+
7+
# Define the events that trigger the workflow
8+
on:
9+
# Trigger on push events to the main branch
10+
push:
11+
branches: [ "main" ]
12+
# Trigger on pull request events to the main branch
13+
pull_request:
14+
branches: [ "main" ]
15+
16+
# Define the jobs in the workflow
17+
jobs:
18+
# Define a job called "build"
19+
build:
20+
# Specify the environment for the job (in this case, macOS with Xcode)
21+
runs-on: macos-latest
22+
23+
# Define the steps in the job
24+
steps:
25+
# Checkout the repository code
26+
- uses: actions/checkout@v4
27+
28+
# Set up Xcode (use apple/setup-xcode to specify the version of Xcode)
29+
- name: Set up Xcode
30+
uses: apple/setup-xcode@v3
31+
with:
32+
xcode-version: '15.0.1' # Specify your Xcode version
33+
34+
# Optionally resolve SPM dependencies
35+
- name: Resolve SPM dependencies
36+
run: |
37+
if [ -f Package.swift ]; then
38+
swift package resolve
39+
fi
40+
41+
# Build the Swift project
42+
- name: Build
43+
run: swift build -v
44+
45+
# Run the tests
46+
- name: Run tests
47+
run: swift test -v
48+
49+

0 commit comments

Comments
 (0)