diff --git a/.github/workflows/objective-c-xcode.yml b/.github/workflows/objective-c-xcode.yml new file mode 100644 index 0000000..c41acab --- /dev/null +++ b/.github/workflows/objective-c-xcode.yml @@ -0,0 +1,65 @@ +name: Xcode - Build and Analyze + +on: + push: + branches: + - master + pull_request: + branches: + - master + +env: + LC_CTYPE: en_US.UTF-8 + LANG: en_US.UTF-8 + LANGUAGE: en_US.UTF-8 + +jobs: + cancel-previous: + name: Cancel Previous + permissions: + contents: read + actions: write + runs-on: ubuntu-latest + steps: + - name: Cancel Previous Build + uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ secrets.GITHUB_TOKEN }} + danger: + name: Check Danger + runs-on: ubuntu-latest + needs: cancel-previous + env: + DANGER_GITHUB_BEARER_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Check + run: bundle exec danger + + build: + name: Build and analyse default scheme using xcodebuild command + runs-on: macos-latest + needs: cancel-previous + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + - name: Setup + run: make setup + - name: Test code Coverage + run: | + make cibuild FL_LANE=code_coverage FASTLANE_ENV=default + bash <(curl -s https://codecov.io/bash) -J 'DataKit' + - name: Build iOS + run: make cibuild FASTLANE_ENV=ios13_xcode11 + - name: Build macOS + run: make cibuild FASTLANE_ENV=osx15 diff --git a/.ruby-version b/.ruby-version index e70b452..1f7da99 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.0 +2.7.7 diff --git a/Gemfile b/Gemfile index 9068f2b..6223630 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source "https://rubygems.org" -ruby "~>2.6" +ruby "~>2.7" gem "fastlane", "~>2.206" gem "danger", "~>8.4" diff --git a/Gemfile.lock b/Gemfile.lock index 3a011fe..dcd14e4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -348,7 +348,7 @@ DEPENDENCIES xcodeproj (~> 1.21) RUBY VERSION - ruby 2.6.5p114 + ruby 2.7.7p221 BUNDLED WITH 1.17.3 diff --git a/script/bootstrap b/script/bootstrap index 04cab2d..400f3c5 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -1,9 +1,9 @@ -#!/bin/sh +#!/usr/bin/env bash # script/bootstrap: Resolve all dependencies that the application requires to # run. -set -ev +set -eo pipefail cd "$(dirname "$0")/.." @@ -33,9 +33,13 @@ fi # fi if [ -f "Gemfile" ]; then + hash bundle 2>/dev/null || { + echo "==> Installing gem bundler 2.1.4…" + gem install bundler -v 2.1.4 --no-document --quiet + } echo "==> Installing gem dependencies…" - gem install bundler -v 2.0.1 --no-document --quiet - bundle check --path vendor/gems >/dev/null 2>&1 || { - bundle install --path vendor/gems --quiet --without production + bundle config set path 'vendor/gems' + bundle check >/dev/null 2>&1 || { + bundle install --quiet } fi diff --git a/script/build b/script/build index 4d22fab..aa86746 100755 --- a/script/build +++ b/script/build @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # script/build: Build the application.s diff --git a/script/cibuild b/script/cibuild index f4d2019..725f30d 100755 --- a/script/cibuild +++ b/script/cibuild @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # script/cibuild: Setup environment for CI to run tests. This is primarily # designed to run on the continuous integration server. diff --git a/script/lint b/script/lint index fd12661..d3fa4dd 100755 --- a/script/lint +++ b/script/lint @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # script/lint: Run lint for application. diff --git a/script/server b/script/server deleted file mode 100755 index 7325252..0000000 --- a/script/server +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# script/server: Launch the application and any extra required processes -# locally. - -set -ev - -cd "$(dirname "$0")/.." - -# ensure everything in the app is up to date. -script/update - -echo "Server is not applicable for this project" diff --git a/script/setup b/script/setup index b32b70d..e480a8d 100755 --- a/script/setup +++ b/script/setup @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # script/setup: Set up application for the first time after cloning, or set it # back to the initial first unused state. diff --git a/script/test b/script/test index 5a6e6b2..d713202 100755 --- a/script/test +++ b/script/test @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # script/test: Run test suite for application. Optionally pass in a path to an # individual test file to run a single test. diff --git a/script/update b/script/update index 03f6baa..7d3cba7 100755 --- a/script/update +++ b/script/update @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash # script/update: Update application to run for its current checkout.