Skip to content

Commit

Permalink
Merge pull request #2850 from AlchemyCMS/unify-build-workflow
Browse files Browse the repository at this point in the history
[CI] Unify build workflow into one file again
  • Loading branch information
tvdeyen authored Apr 26, 2024
2 parents 4473c22 + 438c8ff commit 350423b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 45 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/build.yml

This file was deleted.

42 changes: 39 additions & 3 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,47 @@ on:
pull_request:

jobs:
Build:
uses: ./.github/workflows/build.yml
check_yarn_lock:
runs-on: ubuntu-latest
name: Check yarn.lock
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history
- name: Get changed files
id: changed-yarn-lock
uses: tj-actions/changed-files@v41
with:
files: yarn.lock
outputs:
yarn_lock_changed: ${{ steps.changed-yarn-lock.outputs.any_changed }}

build_javascript:
runs-on: ubuntu-latest
name: Build JS packages
needs: check_yarn_lock
if: needs.check_yarn_lock.outputs.yarn_lock_changed == 'true'
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
cache: "yarn"
- name: Restore node_modules cache
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-modules
- name: Install dependencies
run: yarn install
- name: YARN build
run: yarn build

RSpec:
needs: Build
needs: [check_yarn_lock, build_javascript]
if: ${{ success('check_yarn_lock') && !failure('build_javascript')}}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down

0 comments on commit 350423b

Please sign in to comment.