ci-schedule #142
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
# Note: jobs of ci-contributors.yml, ci-schedule.yml and ci-dispatch.yml should be in sync | |
name: ci-schedule | |
on: | |
workflow_dispatch: | |
schedule: | |
# 12:00 PM IST / 6:30 AM GMT every 6th day over the year with following conditions. | |
# GitHub will remove any cache entries that have not been accessed in over 7 days. | |
# 1. 1 day early in March on 5th for non leap year adjustment. | |
# 2. To not continue cache in next year remove 30 from December. | |
- cron: '30 6 5,11,17,23,29 1 *' | |
- cron: '30 6 4,10,16,22,28 2 *' | |
- cron: '30 6 5,11,17,23,29 3 *' | |
- cron: '30 6 4,10,16,22,28 4 *' | |
- cron: '30 6 4,10,16,22,28 5 *' | |
- cron: '30 6 3,9,15,21,27 6 *' | |
- cron: '30 6 3,9,15,21,27 7 *' | |
- cron: '30 6 2,8,14,20,26 8 *' | |
- cron: '30 6 1,7,13,19,25 9 *' | |
- cron: '30 6 1,7,13,19,25,31 10 *' | |
- cron: '30 6 6,12,18,24,30 11 *' | |
- cron: '30 6 6,12,18,24,30 12 *' | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
ci-schedule: | |
name: CI Scheduled on ${{ matrix.runner }} using Flutter ${{ matrix.ref }} | |
runs-on: ${{ matrix.runner }} | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
matrix: | |
runner: [ ubuntu-latest, macos-latest, windows-latest ] | |
ref: [ stable ] | |
experimental: [ false ] | |
include: | |
- runner: macos-latest | |
ref: beta | |
experimental: true | |
steps: | |
- run: git config --global core.autocrlf false | |
if: runner.os == 'Windows' | |
- run: brew install bash | |
if: runner.os == 'macOS' | |
# - run: echo '${{ toJSON(github) }}' | |
- id: get-checkout-ref | |
run: | | |
if [[ $GITHUB_EVENT_NAME == "pull_request" ]]; then | |
CHECKOUT_REF="$(jq -r .pull_request.head.ref "$GITHUB_EVENT_PATH")" | |
else | |
CHECKOUT_REF="$GITHUB_REF_NAME" | |
fi | |
echo "CHECKOUT_REF=$CHECKOUT_REF" >> "$GITHUB_OUTPUT" | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ steps.get-checkout-ref.outputs.CHECKOUT_REF }} | |
- uses: hrishikesh-kadam/setup-flutter@v1 | |
with: | |
ref: ${{ matrix.ref }} | |
setFlutterRootPath: 'true' | |
addPubCacheBinToPath: 'true' | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- run: ./tool/prerequisite.sh --minimal | |
# https://github.com/actions/cache/blob/main/examples.md#java---gradle | |
- name: Cache Gradle | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
key: gradle-${{ matrix.runner }}-flutter-${{ matrix.ref }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
- run: ./tool/ci.sh "$(./tool/get-flavor-env.sh)" | |
- uses: codecov/codecov-action@v4 | |
with: | |
files: coverage/lcov.info | |
name: ci-schedule-${{ matrix.runner }}-${{ matrix.ref }} | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- run: ./tool/android/stop-gradle.sh |