Skip to content

Commit

Permalink
feat: Add Github Action
Browse files Browse the repository at this point in the history
Rakefile add build script
  • Loading branch information
rakuyoMo committed Apr 21, 2024
1 parent abc4a2d commit 8ffec0a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Swift Build

on:
push:
branches: [main]
paths: ["**/*.swift"]
pull_request:
branches: [main]
paths: ["**/*.swift"]
workflow_dispatch:

jobs:
build:
name: Xcode ${{ matrix.xcode }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-14]
xcode: ["15"]
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- name: Lint
run: rake swift:lint
- name: Build
run: rake swift:build
6 changes: 6 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FORMAT_COMMAND = 'swift package --allow-writing-to-package-directory format'
BUILD_COMMAND = 'xcodebuild -scheme RakuyoKit -destination'

namespace :swift do
desc 'Run Format'
Expand All @@ -10,4 +11,9 @@ namespace :swift do
task :lint do
sh FORMAT_COMMAND + ' --lint'
end

desc 'Build'
task :build do
sh BUILD_COMMAND + " 'platform=iOS Simulator,OS=17.4,name=iPhone 15 Pro'"
end
end

0 comments on commit 8ffec0a

Please sign in to comment.