NX Github Actions
A set of Github Actions for NX workspaces
project | version | description |
---|---|---|
@e-square/nx-affected-matrix | Uses NX's affected utils to calculate the changes. Outputs a matrix of the distributed tasks | |
@e-square/nx-distributed-task | Execute each distributed task from the matrix generated from nx-affected-matrix action |
Features
- ✅ Distribution of tasks across multiple parallel jobs
- ✅ GitHub Cache support
- ✅ GitHub artifacts support
- ✅ NX Cloud support
Table of Contents
Usage
Here's an example of a workflow file that uses both actions
jobs:
setup:
runs-on: ubuntu-latest
name: Affected Matrix
outputs:
hasChanges: ${{ steps.affected.outputs.hasChanges }}
matrix: ${{ steps.affected.outputs.matrix }}
steps:
- name: Calculate affected projects
uses: e-square-io/nx-affected-matrix@v2
id: affected
with:
targets: 'test,build'
maxDistribution: 3
workingDirectory: ''
args: ''
execute:
name: ${{ matrix.target }}
if: ${{ fromJSON(needs.setup.outputs.hasChanges) }}
needs: [setup]
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.target == 'test' }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.setup.outputs.matrix) }}
steps:
# Checkout, cache, install node modules
- name: Execute
uses: e-square-io/nx-distributed-task@v2
id: execute
with:
target: ${{ matrix.target }}
projects: ${{ matrix.projects }}
uploadOutputs: true
nxCloud: false
args: ''
Contributors ✨
Thanks goes to these wonderful people (emoji key):
Ron Netzer 💻 🖋 🎨 📖 🤔 🚧 |
Robin Pellegrims 🐛 💻 |
Steven Rathbauer 💻 🚧 🛡️ |
This project follows the all-contributors specification. Contributions of any kind welcome!
Icons made by Freepik from www.flaticon.com