Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache Deno project dependencies #138

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/actions/setup-deno-with-cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 🦕 Setup Deno with Cache
description: Install Deno and cache project dependencies

runs:
using: composite

steps:
- name: 🦕 Setup Deno
uses: denoland/setup-deno@5e01c016a857a4dbb5afe9d0f9733cd472cba985 # v1.5.1
with:
deno-version: v1.x

- name: 🫙 Cache Deno Dependencies
uses: actions/cache@3624ceb22c1c5a301c8db4169662070a689d9ea8 # v4.1.1
with:
path: |
~/.deno
~/.cache/deno
key: ${{ runner.os }}-deno-${{ hashFiles('./deno.lock') }}
restore-keys: ${{ runner.os }}-deno-
30 changes: 10 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ jobs:
- name: 🚚 Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: 🦕 Setup Deno
uses: denoland/setup-deno@5e01c016a857a4dbb5afe9d0f9733cd472cba985 # v1.5.1
with:
deno-version: v1.x
- name: 🦕 Setup Deno with Cache
uses: ./.github/actions/setup-deno-with-cache

- name: 🧹 Lint Check
run: deno lint
Expand All @@ -42,10 +40,8 @@ jobs:
- name: 🚚 Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: 🦕 Setup Deno
uses: denoland/setup-deno@5e01c016a857a4dbb5afe9d0f9733cd472cba985 # v1.5.1
with:
deno-version: v1.x
- name: 🦕 Setup Deno with Cache
uses: ./.github/actions/setup-deno-with-cache

- name: 📝 Format Check
run: deno fmt --check
Expand All @@ -58,10 +54,8 @@ jobs:
- name: 🚚 Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: 🦕 Setup Deno
uses: denoland/setup-deno@5e01c016a857a4dbb5afe9d0f9733cd472cba985 # v1.5.1
with:
deno-version: v1.x
- name: 🦕 Setup Deno with Cache
uses: ./.github/actions/setup-deno-with-cache

- name: 🔍 Type Check
run: deno check ./src
Expand All @@ -74,10 +68,8 @@ jobs:
- name: 🚚 Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: 🦕 Setup Deno
uses: denoland/setup-deno@5e01c016a857a4dbb5afe9d0f9733cd472cba985 # v1.5.1
with:
deno-version: v1.x
- name: 🦕 Setup Deno with Cache
uses: ./.github/actions/setup-deno-with-cache

- name: 🧪 Run Tests
run: deno task cov
Expand All @@ -95,10 +87,8 @@ jobs:
- name: 🚚 Checkout Repository
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1

- name: 🦕 Setup Deno
uses: denoland/setup-deno@5e01c016a857a4dbb5afe9d0f9733cd472cba985 # v1.5.1
with:
deno-version: v1.x
- name: 🦕 Setup Deno with Cache
uses: ./.github/actions/setup-deno-with-cache

- name: 📦 Dry Run Publish
run: deno publish --dry-run