diff --git a/.github/actions/setup-deno-with-cache/action.yml b/.github/actions/setup-deno-with-cache/action.yml new file mode 100644 index 0000000..dda24d8 --- /dev/null +++ b/.github/actions/setup-deno-with-cache/action.yml @@ -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- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96e38a6..99b9f22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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