mirror of
https://github.com/seemoo-lab/openhaystack.git
synced 2026-08-19 19:46:24 +00:00
- drop SwiftLint in favor of swift-format - disable autoformatting in build phase (otherwise we loose history) - add Git pre-commit hook to autoformat before committing
54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
name: "Build application"
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
paths:
|
|
- OpenHaystack/**
|
|
pull_request:
|
|
branches: [ main ]
|
|
paths:
|
|
- OpenHaystack/**
|
|
|
|
env:
|
|
APP: OpenHaystack
|
|
defaults:
|
|
run:
|
|
working-directory: OpenHaystack
|
|
|
|
jobs:
|
|
format-swift:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: "Checkout code"
|
|
uses: actions/checkout@v2
|
|
- name: "Install swift-format"
|
|
run: brew install swift-format
|
|
- name: "Run swift-format"
|
|
run: swift-format --recursive --mode lint .
|
|
|
|
format-objc:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- name: "Checkout code"
|
|
uses: actions/checkout@v2
|
|
- name: "Install clang-format"
|
|
run: brew install clang-format
|
|
- name: "Run clang-format"
|
|
run: clang-format -n **/*.{h,m}
|
|
|
|
build-app:
|
|
runs-on: macos-latest
|
|
needs:
|
|
- format-swift
|
|
- format-objc
|
|
steps:
|
|
- name: "Checkout code"
|
|
uses: actions/checkout@v2
|
|
- name: "Select Xcode 12"
|
|
uses: devbotsxyz/xcode-select@v1
|
|
with:
|
|
version: "12"
|
|
- name: "Archive project"
|
|
run: xcodebuild archive -scheme ${APP} -configuration release -archivePath ${APP}.xcarchive
|