subosito / flutter-action

Flutter environment for use in GitHub Actions. It works on Linux, Windows, and macOS.
MIT License
2.16k stars 193 forks source link

Caching ignores the `architecture` parameter #219

Closed bcgreijnlautier closed 1 year ago

bcgreijnlautier commented 1 year ago

When running flutter-action v2.9.0, the value of :arch: is getting set to arm64 instead of x64, causing my CI to fail with the following error:

/Users/runner/hostedtoolcache/flutter/stable-3.0.2-arm64/bin/cache/dart-sdk/bin/dart: Bad CPU type in executable

I'm using flutter-action with the following config:

    - name: 'Cache Flutter'
      uses: subosito/flutter-action@v2
      with:
        flutter-version: '3.0.2'
        architecture: x64
        cache: true
        cache-key: 'flutter-:os:-:channel:-:version:'

and this results in the following output:

Run subosito/flutter-action@v2
Run $GITHUB_ACTION_PATH/setup.sh -p -c '/Users/runner/hostedtoolcache/flutter/:channel:-:version:-:arch:' -k 'flutter-:os:-:channel:-:version:' -n '3.0.2' -a 'x64' stable
Run actions/cache@v3
Cache not found for input keys: flutter-macos-stable-3.0.2-ba2a60128b544d2473d544d89582d7faa644cef900b7b91545[38](https://github.com/mobilecoinofficial/mobilecoin-app/actions/runs/4482965144/jobs/7881688372?pr=1560#step:6:40)75b7186bc2fa, flutter-macos-stable-3.0.2-ba2a60128b544d2473d544d89582d7faa644cef900b7b915453875b7186bc2fa, flutter-macos-stable-3.0.2
Run $GITHUB_ACTION_PATH/setup.sh -c '/Users/runner/hostedtoolcache/flutter/stable-3.0.2-arm64' -n '3.0.2' -a 'arm64' stable

So even the the action recognizes the architecture: x64 parameter, it's running setup.sh in the final step with -a 'arm64'

subosito commented 1 year ago

Fix this issue at https://github.com/subosito/flutter-action/commit/1508160852fb97248640997f7cfb38da241df0ba. Just released v2.9.1 and updated v2 for that.