Skip to content

Update dart.yml due to discontinued platform #504

Update dart.yml due to discontinued platform

Update dart.yml due to discontinued platform #504

Workflow file for this run

# Tests for general `setup-dart` configurations.
name: Dart
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "0 0 * * 0" # Run every Sunday at 00:00.
jobs:
# Default test configurations.
test:
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: example
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
sdk: [2.14.4, stable, beta, dev]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ./
with:
sdk: ${{ matrix.sdk }}
- name: Print DART_HOME
run: echo "Dart SDK installed in $DART_HOME"
- run: dart pub get
- run: dart run bin/main.dart
- run: dart analyze
- run: dart test
# Test the raw SDK flavor.
test_raw:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
sdk: [dev, main]
flavor: [raw]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ./
with:
sdk: ${{ matrix.sdk }}
- name: Run hello world
run: |
echo "main() { print('hello world'); }" > hello.dart
dart hello.dart
# Test the architecture input parameter.
test_arch:
strategy:
fail-fast: false
matrix:
# Available runners in public repos:
# https://docs.github.com/en/actions/how-tos/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
include:
# The default MacOS tests above use x64; here we cover arm64.
- os: macos-latest
arch: arm64
sdk: dev
- os: macos-latest
arch: arm64
sdk: stable
# The default linux tests above use x64; here we cover arm64.
# There is no 'ubuntu-arm-latest' runner, so we're pinning to 24.04:
# https://github.com/orgs/community/discussions/148648#discussioncomment-11858187
- os: ubuntu-24.04-arm
arch: arm64
sdk: dev
- os: ubuntu-24.04-arm
arch: arm64
sdk: stable
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./
with:
architecture: arm64
- name: Run hello world
run: |
echo "main() { print('hello world'); }" > hello.dart
dart hello.dart
# Test inferring the channel from the sdk parameter.
test_inferred_channels:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [2.12.0-29.10.beta]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ./
with:
sdk: ${{ matrix.sdk }}
- name: Run hello world
run: |
echo "main() { print('hello world'); }" > hello.dart
dart hello.dart
- run: dart --version
# Test getting the latest patch release for a major.minor sdk parameter.
test_latest_patch_release:
runs-on: ubuntu-latest
strategy:
matrix:
sdk: [2.19, 3.0, 3.1]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: ./
with:
sdk: ${{ matrix.sdk }}
- name: Run hello world
run: |
echo "main() { print('hello world'); }" > hello.dart
dart hello.dart
- run: dart --version