diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..af0a11a --- /dev/null +++ b/.github/workflows/build.yaml @@ -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 diff --git a/Rakefile b/Rakefile index 1c8024e..6c7d9ae 100644 --- a/Rakefile +++ b/Rakefile @@ -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' @@ -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