Skip to content

chore: add lint and tests workflow to project #3

chore: add lint and tests workflow to project

chore: add lint and tests workflow to project #3

Workflow file for this run

name: Article Idea Generator Basic Checks
env:
FLUTTER_VERSION: "3.16.8"
on:
pull_request:
branches: ["main"]
concurrency:
group: basic-checks-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# https://github.com/marketplace/actions/setup-flutter-sdk
- name: Setup Flutter SDK
uses: flutter-actions/[email protected]
with:
channel: "stable"
version: $FLUTTER_VERSION
- name: Cache Flutter Packages
id: cache-flutter-packages
uses: actions/cache@v3
env:
cache-name: cache-flutter-packages
with:
path: |
~/.dart_tool
~/.pub-cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: flutter pub get
- name: Analyze project
run: flutter analyze
unit-tests:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v3
# https://github.com/marketplace/actions/setup-flutter-sdk
- name: Setup Flutter SDK
uses: flutter-actions/[email protected]
with:
channel: "stable"
version: $FLUTTER_VERSION
- name: Cache Flutter Packages
id: cache-flutter-packages
uses: actions/cache@v3
env:
cache-name: cache-flutter-packages
with:
path: |
~/.dart_tool
~/.pub-cache
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: flutter pub get
- name: Run unit test
run: flutter test