Skip to content

Merge pull request #1 from phanatagama/development #2

Merge pull request #1 from phanatagama/development

Merge pull request #1 from phanatagama/development #2

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
# Declare default permissions as read only.
permissions: read-all
jobs:
unit-test:
name: Unit tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
channel: master
- run: flutter doctor -v
# Checkout gallery code and get packages.
- name: Checkout gallery code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- run: flutter pub get
# Analyze, check formatting, and run unit tests.
- run: flutter analyze
- name: Ensure the Dart code is formatted correctly
run: dart format --set-exit-if-changed .
- name: Run Flutter unit tests
run: flutter test --coverage
# Upload coverage to codecov
- name: Upload coverage to codecov
uses: codecov/codecov-action@v2.1.0
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage/lcov.info
benchmark-test:
name: Benchmark tests
runs-on: ubuntu-latest
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
channel: master
- run: flutter doctor -v
# Checkout gallery code and get packages.
- name: Checkout gallery code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- run: flutter pub get
- run: flutter test test_benchmarks
golden-test:
name: Golden tests
runs-on: macos-latest
steps:
# Set up Flutter.
- name: Clone Flutter repository with master channel
uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa
with:
channel: master
- run: flutter doctor -v
# Checkout gallery code and get packages.
- name: Checkout gallery code
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- run: flutter pub get
# Run the golden tests and upload failed test artifacts.
- run: flutter test test_goldens
- name: Upload goldens if tests fail
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
if: failure()
with:
name: goldens
path: test_goldens/failures/