From 947664ba0c2411d5eacc10e67bd2c171be4fe92a Mon Sep 17 00:00:00 2001 From: Alec Thomas Date: Thu, 21 Dec 2023 13:49:08 +1100 Subject: [PATCH] fix: CI was caching incorrect directory for Hermit (#19) --- .github/workflows/ci.yml | 8 ++--- Justfile | 55 +++++++++++++++++++++++++++++++ Makefile | 70 ---------------------------------------- bin/.just-1.16.0.pkg | 1 + bin/just | 1 + 5 files changed, 61 insertions(+), 74 deletions(-) create mode 100644 Justfile delete mode 100644 Makefile create mode 120000 bin/.just-1.16.0.pkg create mode 120000 bin/just diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0621fff..86cf5b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,16 +19,16 @@ jobs: - name: Cache Flutter uses: actions/cache@v3 with: - path: ~/.cache/hermit/cache/pkg + path: ~/.cache/hermit/pkg key: ${{ runner.os }}-hermit-cache-${{ hashFiles('bin/.*.pkg') }} restore-keys: | ${{ runner.os }}-hermit-cache- - name: Install Dependencies - run: make get + run: just get - name: Run Flutter Analyze - run: make analyze + run: just analyze - name: Run Flutter Test - run: make test + run: just test diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..055f1db --- /dev/null +++ b/Justfile @@ -0,0 +1,55 @@ +# Run the Flutter app +run: + flutter run + +# Get packages +get: + #!/bin/bash + echo "Getting dependencies for main project" + flutter pub get + echo "Getting dependencies for packages" + for dir in packages/*; do \ + if [ -d $dir ]; then \ + echo "Getting dependencies in $dir"; \ + (cd $dir && flutter pub get || dart pub get); \ + fi \ + done + +# Clean the project +clean: + flutter clean + +# Build the app for release +build: + flutter build apk + +# Run tests +test: test-app test-packages + +# Run Flutter tests +test-app: + @echo "Running Flutter tests" + @flutter test + +# Run package tests +test-packages: + @echo "Running Dart tests in packages" + @for dir in packages/*; do \ + if [ -d $dir ]; then \ + echo "Running tests in $dir"; \ + (cd $dir && dart test); \ + fi \ + done + +# Analyze the project's Dart code +analyze: + @flutter analyze + @for dir in packages/*; do \ + if [ -d $dir ]; then \ + (cd $dir && dart analyze); \ + fi \ + done + +# Generate code +generate: + flutter gen-l10n \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index e8c6f43..0000000 --- a/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -.PHONY: all -all: run - -.PHONY: run -run: - flutter run - -.PHONY: get -get: - @echo "Getting dependencies for main project" - @flutter pub get - @echo "Getting dependencies for packages" - @for dir in packages/*; do \ - if [ -d $$dir ]; then \ - echo "Getting dependencies in $$dir"; \ - (cd $$dir && flutter pub get || dart pub get); \ - fi \ - done - - -.PHONY: clean -clean: - flutter clean - -.PHONY: build -build: - flutter build apk - -.PHONY: test -test: test-app test-packages - -.PHONY: test-app -test-app: - @echo "Running Flutter tests" - @flutter test - -.PHONY: test-packages -test-packages: - @echo "Running Dart tests in packages" - @for dir in packages/*; do \ - if [ -d $$dir ]; then \ - echo "Running tests in $$dir"; \ - (cd $$dir && dart test); \ - fi \ - done - -.PHONY: analyze -analyze: - @flutter analyze - @for dir in packages/*; do \ - if [ -d $$dir ]; then \ - (cd $$dir && dart analyze); \ - fi \ - done - -.PHONY: generate -generate: - flutter gen-l10n - -.PHONY: help -help: - @echo "Available commands:" - @echo " make run - Run the Flutter app" - @echo " make get - Get packages" - @echo " make clean - Clean the project" - @echo " make build - Build the app for release" - @echo " make test - Run tests" - @echo " make analyze - Analyze the project's Dart code" - @echo " make generate - Generate code" - @echo " make watch - Watch for file changes and generate code automatically" diff --git a/bin/.just-1.16.0.pkg b/bin/.just-1.16.0.pkg new file mode 120000 index 0000000..383f451 --- /dev/null +++ b/bin/.just-1.16.0.pkg @@ -0,0 +1 @@ +hermit \ No newline at end of file diff --git a/bin/just b/bin/just new file mode 120000 index 0000000..1719b2d --- /dev/null +++ b/bin/just @@ -0,0 +1 @@ +.just-1.16.0.pkg \ No newline at end of file