Skip to content

Commit 0b0471d

Browse files
committed
Add .github/dependabot.yml, .github/workflows/CI.yml
1 parent f8de7b1 commit 0b0471d

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
8+
- package-ecosystem: "swift"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

.github/workflows/CI.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
7+
test:
8+
name: Swift ${{ matrix.swift }} on ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
os:
12+
- ubuntu-latest
13+
# - macos-latest
14+
swift: ["5.9"]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: ./.github/workflows/actions/setup
19+
with:
20+
swift: ${{ matrix.swift }}
21+
os: ${{ matrix.os }}
22+
23+
- run: swift build
24+
- run: swift test
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Setup
2+
3+
description: Setup for swift, cache, etc.
4+
5+
inputs:
6+
swift:
7+
required: true
8+
os:
9+
required: true
10+
11+
runs:
12+
using: 'composite'
13+
steps:
14+
- uses: swift-actions/setup-swift@v1
15+
with:
16+
swift-version: ${{ inputs.swift }}
17+
18+
- if: contains(inputs.os, 'macos')
19+
uses: irgaly/xcode-cache@v1
20+
with:
21+
key: xcode-cache-deriveddata-${{ github.workflow }}-${{ github.sha }}
22+
restore-keys: xcode-cache-deriveddata-${{ github.workflow }}-
23+
# There is no `Xcode/DerivedData`; use `.build` instead.
24+
deriveddata-directory: .build
25+
26+
# Hint: Use Composite Actions
27+
# - https://stackoverflow.com/a/75735736/9801139
28+
# - https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-public-action-in-a-subdirectory
29+
# - https://docs.github.com/en/actions/creating-actions/creating-a-composite-action
30+
# - https://dev.to/n3wt0n/composite-actions-vs-reusable-workflows-what-is-the-difference-github-actions-11kd

0 commit comments

Comments
 (0)