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

CONFIG: Update workflows #88

Merged
merged 1 commit into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
37 changes: 12 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ concurrency:
group: "ci-${{ github.head_ref || github.run_id }}"
cancel-in-progress: true

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

jobs:
build-test:
name: Build and Test
runs-on: macos-12
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -30,36 +33,20 @@ jobs:
${{ runner.os }}-spm-

- name: Lint
run: swift package plugin swiftlint --strict --reporter github-actions-logging
run: swiftlint --strict --reporter github-actions-logging

- name: Build
run: swift build --build-tests
run: swift build -Xswiftc -warnings-as-errors --build-tests

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

codeScan:
name: Code Scan
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Scan
uses: MobSF/mobsfscan@main
with:
args: '. --sarif --output results.sarif || true'

- name: Upload report
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
run: swift test --skip-build --parallel --filter TMDbTests

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

build-documentation:
name: Build Documentation
runs-on: macos-12
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -73,4 +60,4 @@ jobs:
${{ runner.os }}-spm-

- name: Build
run: swift package generate-documentation
run: swift package generate-documentation --product TMDb
40 changes: 40 additions & 0 deletions .github/workflows/code-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Code Scan

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

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

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

jobs:
codeScan:
name: Code Scan
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Scan
uses: MobSF/mobsfscan@main
with:
args: '. --sarif --output results.sarif || true'

- name: Upload report
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Documentation

on:
release:
types:
- published
push:
branches:
- main
workflow_dispatch:

permissions:
Expand All @@ -13,21 +13,32 @@ permissions:

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

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

jobs:
deploy:
name: Deploy
name: Deploy Documentation
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}documentation/tmdb
runs-on: macos-12
url: ${{ steps.deployment.outputs.page_url }}documentation/policedatakit
runs-on: macos-13
steps:
- name: Checkout
uses: actions/checkout@v3

- 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-

- name: Build documentation
run: |
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Integration

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

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

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

jobs:
integration-test:
name: Integration Test
runs-on: macos-13
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: Build
run: swift build --build-tests

- name: Test
run: swift test --skip-build --filter TMDbIntegrationTests