Skip to content

Commit

Permalink
refactor: Update tests.yml to download and cache Go echo server
Browse files Browse the repository at this point in the history
This commit modifies the tests.yml file to download and cache the Go echo server artifact. It removes the previous step that uploaded the echo server artifact and replaces it with a new step that downloads and restores the cached artifact using the actions/cache/restore action. This change improves the efficiency of the workflow by avoiding unnecessary artifact uploads and ensures consistent usage of the echo server across different workflow runs.
  • Loading branch information
PlugFox committed Jul 19, 2024
1 parent 8d18aee commit 07a9d2a
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,6 @@ jobs:
~/build/bin/echo
key: ${{ runner.os }}-spinify-${{ env.echo-cache-name }}-${{ hashFiles('tool/echo/echo.go') }}

- name: 💾 Upload Go echo server
id: upload-echo-server
uses: actions/upload-artifact@v4
with:
name: echo-server
path: ~/build/bin/echo
compression-level: 6
overwrite: true
retention-days: 1

tests:
name: "Tests"
runs-on: ubuntu-latest
Expand All @@ -103,6 +93,7 @@ jobs:
image: dart:stable
env:
pub-cache-name: pub
echo-cache-name: echo
timeout-minutes: 15
steps:
- name: 🚂 Get latest code
Expand All @@ -116,11 +107,13 @@ jobs:
test
analysis_options.yaml
- name: 📂 Download Echo server
uses: actions/download-artifact@v4
- name: 📂 Download Go echo server
id: cache-echo-restore
uses: actions/cache/restore@v4
with:
name: echo-server
path: ~/build/bin/
path: |
~/build/bin/echo
key: ${{ runner.os }}-spinify-${{ env.echo-cache-name }}-${{ hashFiles('tool/echo/echo.go') }}

- name: 📤 Restore Pub modules
id: cache-pub-restore
Expand All @@ -141,6 +134,7 @@ jobs:
id: install-dependencies
timeout-minutes: 1
run: |
test -f ~/build/bin/echo
apt-get update && apt-get install -y lcov
dart pub get --no-example
Expand Down

0 comments on commit 07a9d2a

Please sign in to comment.