2022-10-25 19:59:56 +00:00
|
|
|
# This workflow uses actions that are not certified by GitHub.
|
|
|
|
# They are provided by a third-party and are governed by
|
|
|
|
# separate terms of service, privacy policy, and support
|
|
|
|
# documentation.
|
|
|
|
|
2023-05-04 13:44:00 +00:00
|
|
|
name: PR check
|
2022-10-25 19:59:56 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2023-03-30 19:24:18 +00:00
|
|
|
branches: ["main"]
|
2022-10-25 19:59:56 +00:00
|
|
|
pull_request:
|
2023-03-30 19:24:18 +00:00
|
|
|
branches: ["main"]
|
2022-10-25 19:59:56 +00:00
|
|
|
|
2023-09-02 08:32:08 +00:00
|
|
|
env:
|
|
|
|
# Stub iap package if this worlflow is running from the PR from a fork
|
|
|
|
STUB_IAP: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
|
|
|
|
|
2022-10-25 19:59:56 +00:00
|
|
|
jobs:
|
2023-07-25 15:31:01 +00:00
|
|
|
analyze_and_test:
|
|
|
|
name: Analyze & test
|
2023-03-30 19:24:18 +00:00
|
|
|
runs-on: macos-11
|
2023-05-03 10:45:10 +00:00
|
|
|
timeout-minutes: 10
|
2022-10-25 19:59:56 +00:00
|
|
|
steps:
|
2023-09-02 09:50:48 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
2023-09-02 08:32:08 +00:00
|
|
|
- name: Connect private iap package
|
|
|
|
uses: webfactory/ssh-agent@v0.8.0
|
2023-09-02 09:40:17 +00:00
|
|
|
if: ${{ !env.STUB_IAP }}
|
2023-09-02 08:32:08 +00:00
|
|
|
with:
|
|
|
|
ssh-private-key: ${{ secrets.M3_LIGHTMETER_IAP_KEY }}
|
|
|
|
|
|
|
|
- name: Override iap package with stub
|
2023-09-02 09:40:17 +00:00
|
|
|
if: ${{ env.STUB_IAP }}
|
2023-09-02 09:47:03 +00:00
|
|
|
run: bash ./.github/scripts/stub_iap.sh
|
2023-09-02 08:32:08 +00:00
|
|
|
|
2022-10-25 20:03:06 +00:00
|
|
|
- uses: subosito/flutter-action@v2
|
|
|
|
with:
|
|
|
|
channel: "stable"
|
2023-09-02 08:32:08 +00:00
|
|
|
flutter-version: "3.10.0"
|
2023-03-30 19:24:18 +00:00
|
|
|
|
2023-07-25 15:31:01 +00:00
|
|
|
- name: Prepare flutter project
|
2023-05-03 10:45:10 +00:00
|
|
|
run: |
|
2023-07-25 15:31:01 +00:00
|
|
|
flutter --version
|
|
|
|
flutter pub get
|
|
|
|
flutter pub run intl_utils:generate
|
2023-05-03 10:45:10 +00:00
|
|
|
|
2022-10-25 19:59:56 +00:00
|
|
|
- name: Analyze project source
|
2023-02-15 14:34:28 +00:00
|
|
|
run: flutter analyze lib --fatal-infos
|
2023-06-20 06:43:49 +00:00
|
|
|
|
|
|
|
- name: Run tests
|
2023-09-02 08:32:08 +00:00
|
|
|
run: flutter test
|