Skip to content

test

test #293

Workflow file for this run

# This workflow is used to test the packages on all platforms.
name: test
on:
push:
branches:
- main
- master
- develop
- ci
pull_request: # any pull request against any branch
workflow_dispatch: # manual trigger
schedule:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
# * * * * *
# build and format run at 14:00 UTC, so tests use a later window to avoid competing for macOS runners.
- cron: "15 14 * * *" # every day at 14:15 UTC (6:15 PST, 7:15 PDT)
concurrency:
# newer commits cancel older in-flight CI on the same ref.
# scoping the group by event keeps push runs from cancelling scheduled runs (and vice versa).
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name != 'workflow_dispatch' }}
env:
TERM: xterm-256color
DEVELOPER_DIR: /Applications/Xcode_${{ vars.XCODE_VERSION }}.app/Contents/Developer
jobs:
test-codecov:
name: Test (macOS)
runs-on: ${{ vars.MACOS }}
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Cache CI artifacts
uses: ./.github/actions/cache
with:
kind: test-macOS
xcode-version: ${{ vars.XCODE_VERSION }}
- name: Bootstrap
uses: ./.github/actions/bootstrap
# ChouTi
- name: Test package "ChouTi" with Codecov
if: success() || failure()
run: make test-codecov -C packages/ChouTi
- name: Upload package "ChouTi" code coverage
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: packages/ChouTi/.build/debug/codecov/coverage.lcov
disable_search: true
flags: ChouTi
name: ChouTi
fail_ci_if_error: true
# ChouTiTest
- name: Test package "ChouTiTest" with Codecov
if: success() || failure()
run: make test-codecov -C packages/ChouTiTest
- name: Upload package "ChouTiTest" code coverage
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: packages/ChouTiTest/.build/debug/codecov/coverage.lcov
disable_search: true
flags: ChouTiTest
name: ChouTiTest
fail_ci_if_error: true
test:
name: Test
strategy:
fail-fast: false
matrix:
platform: [iOS, tvOS, visionOS, watchOS]
timeout-minutes: 30
runs-on: ${{ vars.MACOS }}
steps:
- name: Check out repository
uses: actions/checkout@v5
- name: Cache CI artifacts
uses: ./.github/actions/cache
with:
kind: test-${{ matrix.platform }}
xcode-version: ${{ vars.XCODE_VERSION }}
- name: Bootstrap
uses: ./.github/actions/bootstrap
# Phases are separate steps for per-phase timing. The simulator boots at
# the start of the Test step, after the build: boot and compile are both
# CPU-heavy, so on few-core CI runners running them serially is faster
# than overlapping them.
- name: Pick simulator
run: make test-ci OS=${{ matrix.platform }} PHASE=pick -C packages/ChouTi
- name: Build for testing
run: make test-ci OS=${{ matrix.platform }} PHASE=build -C packages/ChouTi
- name: Test
run: make test-ci OS=${{ matrix.platform }} PHASE=test -C packages/ChouTi