Skip to content

Commit

Permalink
Housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
adamayoung committed Feb 26, 2024
1 parent abb6bbd commit c1a0660
Show file tree
Hide file tree
Showing 225 changed files with 5,049 additions and 588 deletions.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. ...
2. ...

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Platform (please complete the following information):**
- OS: [e.g. iOS 17.2, macOS 14.2]
- Device: [e.g. iPhone 15, MacBook Pro 16-inch 2021 M1 Pro]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context about the feature request here.
3 changes: 3 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
paths:
- Sources
- Tests
24 changes: 24 additions & 0 deletions .github/workflows/ci-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Documentation CI

on:
pull_request:
branches:
- main
workflow_dispatch:

concurrency:
group: "ci-documentation-${{ github.head_ref || github.run_id }}"
cancel-in-progress: true

jobs:
build-documentation:
name: Build Documentation
runs-on: ubuntu-latest
env:
SWIFTCI_DOCC: 1
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
run: swift package generate-documentation --product PoliceDataKit
78 changes: 43 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,31 @@
name: CI

on:
push:
pull_request:
branches:
- main
pull_request:
push:
branches:
- main
paths:
- ".github/workflows/ci.yml"
- "**/*.swift"
workflow_dispatch:

concurrency:
group: "ci-${{ github.head_ref || github.run_id }}"
cancel-in-progress: true

env:
DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer

jobs:
build-test:
name: Build and Test
runs-on: macos-13
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache SPM
uses: actions/cache@v3
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Lint
run: swiftlint --strict --reporter github-actions-logging
uses: actions/checkout@v4

- name: Build
run: swift build -Xswiftc -warnings-as-errors --build-tests
Expand All @@ -43,27 +35,43 @@ jobs:

- name: Build for Release
run: swift build -c release -Xswiftc -warnings-as-errors

build-documentation:
name: Build Documentation
runs-on: macos-13

build-and-test-platforms:
name: Build and Test (${{ matrix.name }})
runs-on: macos-14
continue-on-error: true
strategy:
matrix:
include:
- name: iOS
destination: platform=iOS Simulator,name=iPhone 15,OS=17.2
- name: watchOS
destination: platform=watchOS Simulator,name=Apple Watch Series 9 (45mm),OS=10.2
- name: tvOS
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=17.2
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Cache SPM
uses: actions/cache@v3
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Install markdownlint-cli
run: brew install markdownlint-cli
uses: actions/checkout@v4

- name: Lint DocC files
run: markdownlint **/*.docc/**/*.md
- name: Build
run: set -o pipefail && env NSUnbufferedIO=YES && xcodebuild build-for-testing -scheme PoliceDataKit -only-testing PoliceDataKitTests -destination '${{ matrix.destination }}' | xcpretty

- name: Test
run: set -o pipefail && env NSUnbufferedIO=YES && xcodebuild test-without-building -scheme PoliceDataKit -only-testing PoliceDataKitTests -destination '${{ matrix.destination }}' | xcpretty

build-test-linux:
name: Build and Test (Linux)
runs-on: ubuntu-latest
container: swift:5.9.2-jammy
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
run: swift package generate-documentation --product PoliceDataKit
run: swift build -Xswiftc -warnings-as-errors --build-tests

- name: Test
run: swift test --skip-build --parallel --filter PoliceDataKitTests

- name: Build for Release
run: swift build -c release -Xswiftc -warnings-as-errors
40 changes: 0 additions & 40 deletions .github/workflows/code-scan.yml

This file was deleted.

47 changes: 47 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CodeQL

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# Every Sunday at 12am
- cron: '0 0 * * 0'
workflow_dispatch:

concurrency:
group: "codeql-${{ github.head_ref || github.run_id }}"
cancel-in-progress: true

env:
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer

jobs:
analyze:
name: Analyze
runs-on: macos-14
timeout-minutes: 120
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: swift
config-file: ./.github/codeql/codeql-config.yml

- name: Build
run: swift build --build-tests

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:swift"
49 changes: 25 additions & 24 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches:
- main
paths:
- ".github/workflows/documentation.yml"
- "**/*.swift"
- "**/*.docc/**/*.md"
workflow_dispatch:

permissions:
Expand All @@ -12,33 +16,20 @@ permissions:
id-token: write

concurrency:
group: "documentation"
cancel-in-progress: false

env:
DEVELOPER_DIR: /Applications/Xcode_14.3.app/Contents/Developer
group: "deploy-documentation"
cancel-in-progress: true

jobs:
deploy:
name: Deploy Documentation
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}documentation/policedatakit
runs-on: macos-13
build:
name: Build
runs-on: ubuntu-latest
container: swift:5.9.2-jammy
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Cache SPM
uses: actions/cache@v3
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
uses: actions/configure-pages@v4

- name: Build documentation
run: |
Expand All @@ -48,12 +39,22 @@ jobs:
--transform-for-static-hosting \
--hosting-base-path police-data-kit \
--output-path docs
env:
SWIFTCI_DOCC: 1

- name: Upload documentation
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
path: 'docs'


deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}documentation/policedatakit
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@main
uses: actions/deploy-pages@v4
Loading

0 comments on commit c1a0660

Please sign in to comment.