Continuous Integration #1056
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# continuous-integration.yml | |
# Created by Felix Mau (https://felix.hamburg) | |
# | |
# Based on: | |
# - https://docs.github.com/en/actions/quickstart | |
# - https://futurestud.io/tutorials/github-actions-trigger-builds-on-schedule-cron#schedulegithubactionsusingacron | |
# - https://about.codecov.io/blog/code-coverage-for-ios-development-using-swift-xcode-and-github-actions/ | |
# | |
name: Continuous Integration | |
on: | |
push: | |
pull_request: | |
schedule: | |
# Run workflow every day at midnight. | |
# | |
# - Note: "Scheduled workflows run on the latest commit on the default or base branch." | |
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events | |
- cron: '0 0 * * *' | |
# Use latest Xcode version. | |
# | |
# Source: | |
# - https://www.jessesquires.com/blog/2020/01/06/selecting-an-xcode-version-on-github-ci/ | |
# - https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md#xcode | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_14.0.app/Contents/Developer | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel. | |
jobs: | |
# This workflow starts with a job called "build-and-test". | |
build-and-test: | |
name: Build & Test | |
runs-on: macos-12 | |
# Steps represent a sequence of tasks that will be executed as part of the job. | |
steps: | |
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." | |
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" | |
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." | |
- name: Check out repository code | |
uses: actions/checkout@v2 | |
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." | |
- run: echo "🖥️ The workflow is now ready to test your code on the runner." | |
- name: Install dependencies | |
working-directory: ./Example | |
run: bundle install | |
- name: Execute SwiftFormat and treat any formatting errors as real errors. | |
working-directory: ./Example | |
run: bundle exec fastlane format | |
- name: Execute SwiftLint and treat any formatting errors as real errors. | |
working-directory: ./Example | |
run: bundle exec fastlane lint | |
- name: Execute tests. | |
working-directory: ./Example | |
run: bundle exec fastlane tests | |
- name: Execute validation Carthage support. | |
working-directory: ./Example | |
run: bundle exec fastlane verify_carthage | |
- name: Execute validation of library. | |
working-directory: ./Example | |
run: bundle exec fastlane pod_lint | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
- run: echo "🍏 This job's status is ${{ job.status }}." |