ci(build): adding cache

This commit is contained in:
Anatoliy Poloz
2024-02-27 16:59:00 +03:00
parent a9af60584d
commit c2cc786c5f
2 changed files with 83 additions and 1 deletions

View File

@@ -20,7 +20,8 @@ jobs:
java-version: "12.x"
cache: "gradle"
- uses: actions/flutter-action@v2
- id: flutter-action
uses: actions/flutter-action@v2
with:
channel: "stable"
flutter-version: "3.19.0"
@@ -30,6 +31,17 @@ jobs:
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
- name: show cache keys
run: |
echo CACHE-PATH=${{ steps.flutter-action.outputs.CACHE-PATH }}
echo CACHE-KEY=${{ steps.flutter-action.outputs.CACHE-KEY }}
echo CHANNEL=${{ steps.flutter-action.outputs.CHANNEL }}
echo VERSION=${{ steps.flutter-action.outputs.VERSION }}
echo ARCHITECTURE=${{ steps.flutter-action.outputs.ARCHITECTURE }}
echo PUB-CACHE-PATH=${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}
echo PUB-CACHE-KEY=${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}
shell: bash
- name: fix dir permissions
run: |
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.19.0-x64

70
.gitea/workflows/test.yml Normal file
View File

@@ -0,0 +1,70 @@
name: Eatvio App Test
on: [pull_request]
env:
flutter_version: "3.19.0"
java_version: "12.x"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install jq
run: |
apt update
apt-get install -y jq
- uses: actions/setup-java@v3
with:
distribution: "zulu"
java-version: ${{ env.java_version }}
cache: "gradle"
- name: Cache Flutter dependencies
uses: actions/cache@v2
with:
path: /opt/hostedtoolcache/flutter
key: ${{ runner.OS }}-flutter-install-cache-${{ env.flutter_version }}
- id: flutter-action
uses: actions/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ env.flutter_version }}
cache: true
cache-key: "flutter-:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache
cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
pub-cache-key: "flutter-pub:os:-:channel:-:version:-:arch:-:hash:" # optional, change this to force refresh cache of dart pub get dependencies
pub-cache-path: "${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:" # optional, change this to specify the cache path
- name: show cache keys
run: |
echo CACHE-PATH=${{ steps.flutter-action.outputs.CACHE-PATH }}
echo CACHE-KEY=${{ steps.flutter-action.outputs.CACHE-KEY }}
echo CHANNEL=${{ steps.flutter-action.outputs.CHANNEL }}
echo VERSION=${{ steps.flutter-action.outputs.VERSION }}
echo ARCHITECTURE=${{ steps.flutter-action.outputs.ARCHITECTURE }}
echo PUB-CACHE-PATH=${{ steps.flutter-action.outputs.PUB-CACHE-PATH }}
echo PUB-CACHE-KEY=${{ steps.flutter-action.outputs.PUB-CACHE-KEY }}
shell: bash
- name: fix dir permissions
run: |
git config --global --add safe.directory /opt/hostedtoolcache/flutter/stable-3.19.0-x64
flutter --version
- name: Get dependencies
run: flutter pub get
- name: Run Code Metrics
run: flutter pub run dart_code_metrics:metrics lib --disable-sunset-warning --fatal-warnings --fatal-performance
# - name: Build apk
# run: flutter build apk
# Runs a set of commands using the runners shell
# - name: Start release build
# run: flutter build appbundle