Skip to content

Commit 12620eb

Browse files
committed
✨ :: Add GitHub action to run formatting, linting and tests
1 parent 88cd0b0 commit 12620eb

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#
2+
# continuous-integration.yml
3+
# Created by Felix Mau (https://felix.hamburg)
4+
#
5+
6+
name: Continuous Integration
7+
on:
8+
pull_request:
9+
push:
10+
branches:
11+
- main
12+
workflow_dispatch:
13+
jobs:
14+
# Lint and Format
15+
# Ensures that the code adheres to the defined style guidelines.
16+
lint-and-format:
17+
runs-on: macos-26
18+
steps:
19+
- name: Check out repository code
20+
uses: actions/checkout@v6
21+
22+
- name: Install SwiftFormat via Homebrew
23+
run: brew install swiftformat
24+
25+
- name: Install SwiftLint via Homebrew
26+
run: brew install swiftlint
27+
28+
- name: SwiftFormat
29+
run: make format-check
30+
31+
- name: SwiftLint
32+
run: make lint
33+
34+
# Tests
35+
# Ensures that the package compiles and that all tests pass, including code coverage reporting to Codecov.
36+
tests:
37+
runs-on: macos-26
38+
needs: lint-and-format
39+
steps:
40+
- name: Check out repository code
41+
uses: actions/checkout@v6
42+
43+
- name: Execute tests
44+
run: make test
45+
46+
- name: Upload coverage to Codecov
47+
uses: codecov/codecov-action@v4
48+
with:
49+
fail_ci_if_error: true
50+
token: ${{ secrets.CODECOV_TOKEN }}
51+
52+
# Build Example Application
53+
# Ensures that the package can be integrated into a real application, to catch any potential issues e.g. with access control.
54+
build-example-application:
55+
runs-on: macos-26
56+
needs: tests
57+
steps:
58+
- name: Check out repository code
59+
uses: actions/checkout@v6
60+
61+
- name: Build Example Application
62+
run: make build-example-application

0 commit comments

Comments
 (0)