Skip to content

Commit

Permalink
build: extract build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
shanedg committed Apr 9, 2024
1 parent 82fe2dc commit f64e7cc
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 48 deletions.
49 changes: 1 addition & 48 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,8 @@ jobs:
uses: ./.github/workflows/install.yml

build:
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v4

- name: Restore Build Cache
id: restore-build-cache
uses: actions/cache/restore@v4
with:
path: |
~/.cache/Cypress
common/temp
*/.rush/temp
*/node_modules
*/dist
key: ${{ runner.os }}-${{ hashFiles('common/config/rush/repo-state.json') }}-build
# Only need a cache hit or miss,
# cached dependencies aren't used until following jobs
lookup-only: true

- name: Restore Dependencies From Cache
id: restore-cache
uses: actions/cache/restore@v4
if: steps.restore-build-cache.outputs.cache-hit != 'true'
with:
path: |
~/.cache/Cypress
common/temp
*/.rush/temp
*/node_modules
key: ${{ runner.os }}-${{ hashFiles('common/config/rush/repo-state.json') }}
fail-on-cache-miss: true

- name: Build
if: steps.restore-build-cache.outputs.cache-hit != 'true'
run: node common/scripts/install-run-rush.js build

- name: Save Build Cache
id: save-cache
uses: actions/cache/save@v4
if: steps.restore-build-cache.outputs.cache-hit != 'true'
with:
path: |
~/.cache/Cypress
common/temp
*/.rush/temp
*/node_modules
*/dist
key: ${{ steps.restore-build-cache.outputs.cache-primary-key }}
uses: ./.github/workflows/build.yml

lint:
runs-on: ubuntu-latest
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Restore Build Cache
id: restore-build-cache
uses: actions/cache/restore@v4
with:
path: |
~/.cache/Cypress
common/temp
*/.rush/temp
*/node_modules
*/dist
key: ${{ runner.os }}-${{ hashFiles('common/config/rush/repo-state.json') }}-build
# Only need a cache hit or miss,
# cached dependencies aren't used until following jobs
lookup-only: true

- name: Restore Dependencies From Cache
id: restore-cache
uses: actions/cache/restore@v4
if: steps.restore-build-cache.outputs.cache-hit != 'true'
with:
path: |
~/.cache/Cypress
common/temp
*/.rush/temp
*/node_modules
key: ${{ runner.os }}-${{ hashFiles('common/config/rush/repo-state.json') }}
fail-on-cache-miss: true

- name: Build
if: steps.restore-build-cache.outputs.cache-hit != 'true'
run: node common/scripts/install-run-rush.js build

- name: Save Build Cache
id: save-cache
uses: actions/cache/save@v4
if: steps.restore-build-cache.outputs.cache-hit != 'true'
with:
path: |
~/.cache/Cypress
common/temp
*/.rush/temp
*/node_modules
*/dist
key: ${{ steps.restore-build-cache.outputs.cache-primary-key }}

0 comments on commit f64e7cc

Please sign in to comment.