Skip to content

Commit

Permalink
Use turbo actions caching for faster builds (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot authored Nov 8, 2023
1 parent ac8a17d commit 4fbf476
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 27 deletions.
18 changes: 18 additions & 0 deletions .github/actions/build-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build Lint Test

runs:
using: "composite"
steps:
- name: Build
run: yarn build --cache-dir=".turbo"
shell: bash
env:
NODE_ENV: production

- name: Lint
run: yarn lint --cache-dir=".turbo"
shell: bash

- name: Test
run: yarn test --cache-dir=".turbo"
shell: bash
10 changes: 10 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,13 @@ runs:
- name: Install dependencies
shell: bash
run: yarn install --frozen-lockfile

- name: Turbo Cache
uses: actions/cache@v3
with:
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
turbo-${{ github.job }}-${{ github.ref_name }}-
turbo-${{ github.job }}-
18 changes: 1 addition & 17 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,9 @@ on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn lint

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn build
env:
NODE_ENV: production

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn test
- uses: ./.github/actions/build-test
15 changes: 5 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,12 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
lint:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn test
- uses: ./.github/actions/build-test

publish:
runs-on: ubuntu-latest
Expand All @@ -36,7 +29,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup
- run: yarn build

- name: Build
run: yarn build --cache-dir=".turbo"
env:
NODE_ENV: production

Expand Down

0 comments on commit 4fbf476

Please sign in to comment.