Skip to content

Commit

Permalink
ci: Also use plan action (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
TriPSs authored Feb 8, 2024
2 parents 8b7536b + 2c3368e commit dfca1e1
Show file tree
Hide file tree
Showing 25 changed files with 58 additions and 378,086 deletions.
63 changes: 55 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:

jobs:

prepare-env:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -28,18 +28,41 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: yarn install

pr:
needs: prepare-env
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: ./actions/set-shas
with:
main-branch-name: master

- name: Plan
id: plan
uses: ./actions/plan
with:
targets: |
test
build
e2e
testMaxJobs: 1

buildMaxJobs: 2

e2eMaxJobs: 2

distributed-task:
name: Distributed ${{ matrix.target }} ${{ matrix.index }}/${{ matrix.count }}
needs:
- setup
runs-on: ubuntu-latest
if: needs.setup.outputs.hasPlan == 'true'
strategy:
fail-fast: false
matrix:
target: [ 'build', 'e2e' , 'test']
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}

steps:
- name: Use Node.js ${{ matrix.node-version }}
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 20.10

- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -73,4 +96,28 @@ jobs:
uses: ./actions/run-many
with:
target: ${{ matrix.target }}
parallel: 1
index: ${{ matrix.index }}
count: ${{ matrix.count }}
tag: ${{ matrix.tag }}
parallel: ${{ matrix.parallel }}

# So we can add branch protection that this one is required
distributed-check:
name: Distributed check
runs-on: ubuntu-latest
needs:
- distributed-task
if: |
!cancelled()
steps:
- name: Check
if: |
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled')
run: echo "Ok"

- name: Fail
if: |
contains(needs.*.result, 'failure') ||
contains(needs.*.result, 'cancelled')
run: exit 1
Binary file removed actions/plan/dist/nx.darwin-arm64.node
Binary file not shown.
1 change: 0 additions & 1 deletion actions/plan/dist/register.js

This file was deleted.

1 change: 0 additions & 1 deletion actions/plan/dist/src/plan.d.ts

This file was deleted.

13 changes: 0 additions & 13 deletions actions/plan/dist/src/utils/exec.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions actions/plan/dist/src/utils/has-one-of-required-tags.d.ts

This file was deleted.

Binary file removed actions/plan/dist/swc.darwin-arm64.node
Binary file not shown.
218 changes: 0 additions & 218 deletions actions/plan/dist/swc.js

This file was deleted.

Loading

0 comments on commit dfca1e1

Please sign in to comment.