Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup ci #19

Merged
merged 7 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: CI

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]


jobs:
lint:
name: Swift Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Check swift codestyle
uses: norio-nomura/action-swiftlint@3.2.1
with:
args: lint --config .swiftlint.yml --strict

test:
name: Build and Test
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Swift
uses: swift-actions/setup-swift@v2
with:
swift-version: "5.10"
- name: Run Script
run: |
chmod +x ./scripts/run.sh
qiweiii marked this conversation as resolved.
Show resolved Hide resolved
make test
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.PHONY: githooks
githooks:
cp .githooks/pre-commit .git/hooks/pre-commit

test: githooks
./scripts/run.sh test
13 changes: 13 additions & 0 deletions scripts/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -e

COMMAND=$1

shift

set -x

for file in **/Package.swift; do
swift $COMMAND $@ --package-path "$(dirname "$file")";
done
Loading