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

Use turbo actions caching for faster builds #163

Merged
merged 5 commits into from
Nov 8, 2023
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
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