Update Flutter and libraries #179
Workflow file for this run
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
--- | |
name: Build, test, and release log_file_client | |
on: | |
- push | |
- pull_request | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: install flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.27.4' | |
channel: 'stable' | |
- name: use cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/.pub-cache | |
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pub-cache- | |
- name: build web application | |
run: | | |
cd extras/log_file_client | |
flutter --version >> /dev/null # avoid welcome message | |
flutter build web | |
tar -czvf /tmp/log_file_client.tar.gz build/web | |
- name: save web files as an artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: log_file_client | |
path: /tmp/log_file_client.tar.gz | |
retention-days: 1 | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: checkout code | |
uses: actions/checkout@v4 | |
- name: install flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.27.4' | |
channel: 'stable' | |
- name: use cache | |
uses: actions/cache@v3 | |
with: | |
path: /home/runner/.pub-cache | |
key: ${{ runner.os }}-pub-cache-${{ hashFiles('**/pubspec.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pub-cache- | |
- name: lint and test | |
run: | | |
cd extras/log_file_client | |
dart pub get # https://github.com/dart-lang/sdk/issues/50422 | |
dart format --output=none --set-exit-if-changed . | |
dart analyze --fatal-infos | |
flutter --version >> /dev/null # avoid welcome message | |
flutter test --concurrency=1 | |
release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: download web files | |
uses: actions/download-artifact@v4 | |
with: | |
name: log_file_client | |
- name: create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: log_file_client.tar.gz |