Skip to content

Commit

Permalink
ci: Generate files and cache them
Browse files Browse the repository at this point in the history
  • Loading branch information
spydon committed Aug 23, 2024
1 parent 40e8f4e commit bc85f71
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 24 deletions.
72 changes: 49 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,46 +8,64 @@ on:
workflow_dispatch:

jobs:
analyze:
setup:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: Atsumi3/[email protected]
- uses: bluefireteam/melos-action@v2
- run: melos analyze --fatal-infos
- run: melos generate
- uses: actions/cache@v3
with:
path: |
.*
**/*
key: ${{ runner.os }}-repo-${{ github.sha }}

format:
analyze:
runs-on: ubuntu-22.04
needs: setup
steps:
- uses: actions/checkout@v3
- name: Restore repository cache
uses: actions/cache@v3
with:
path: |
.
key: ${{ runner.os }}-repo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-repo-
- uses: Atsumi3/[email protected]
- uses: bluefireteam/melos-action@v2
- run: melos format:exclude
- run: melos analyze --fatal-infos

mocks:
format:
runs-on: ubuntu-22.04
needs: setup
steps:
- uses: actions/checkout@v3
- uses: Atsumi3/[email protected]
- uses: bluefireteam/melos-action@v3
- run: melos generate
- name: Check for outdated mocks
if: github.event_name != 'push'
run: ./scripts/check-outdated-files.sh
- name: Create PR
if: github.event_name == 'push'
uses: peter-evans/create-pull-request@v5
- name: Restore repository cache
uses: actions/cache@v3
with:
add-paths: '**/*.mocks.dart'
title: 'chore: regenerate mocks'
commit-message: 'chore: regenerate mocks'
branch: create-pull-request/mocks
delete-branch: true
path: |
.
key: ${{ runner.os }}-repo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-repo-
- uses: Atsumi3/[email protected]
- uses: bluefireteam/melos-action@v2
- run: melos format:exclude

l10n:
runs-on: ubuntu-22.04
needs: setup
steps:
- uses: actions/checkout@v3
- name: Restore repository cache
uses: actions/cache@v3
with:
path: |
.
key: ${{ runner.os }}-repo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-repo-
- uses: Atsumi3/[email protected]
- uses: bluefireteam/melos-action@v2
- run: melos gen-l10n
Expand All @@ -66,8 +84,16 @@ jobs:

test:
runs-on: ubuntu-22.04
needs: setup
steps:
- uses: actions/checkout@v3
- name: Restore repository cache
uses: actions/cache@v3
with:
path: |
.
key: ${{ runner.os }}-repo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-repo-
- uses: Atsumi3/[email protected]
- uses: bluefireteam/melos-action@v2
- run: sudo apt update && sudo apt install -y lcov
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,9 @@ app.*.map.json
**/pubspec_overrides.yaml

# FVM Version Cache
.fvm/
.fvm/

# Generated files
**/*.freezed.dart
**/*.g.dart
**/*.mocks.dart

0 comments on commit bc85f71

Please sign in to comment.