Skip to content

🩺 Quality assurance checks on 🌱 main #801

🩺 Quality assurance checks on 🌱 main

🩺 Quality assurance checks on 🌱 main #801

Workflow file for this run

name: Checks
run-name: 🩺 Quality assurance checks on ${{ github.event_name == 'pull_request' && 'PR' || '🌱' }} ${{ github.event_name == 'pull_request' && github.event.number || github.ref_name }}
env:
NODE_VERSION: 16.17.0
# This workflow runs for Pull Requests which are not draft,
# as well as commits going to the default branch
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, ready_for_review]
# Only allow concurrent checks on the main branch to keep history
# on QA checks
concurrency:
group: checks-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
format-lint-test-build:
if: github.event.pull_request.draft == false
name: Nx Cloud - Main Job
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.11.3
with:
number-of-agents: 3
init-commands: |
npx nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3
parallel-commands: |
npx nx-cloud record -- npx nx format:check
parallel-commands-on-agents: |
npx nx affected --target=lint --parallel=3
npx nx affected --target=test --parallel=3 --ci --code-coverage
npx nx affected --target=build --parallel=3
node-version: 16.17.0 # FIXME: use env.NODE_VERSION
agents:
if: github.event.pull_request.draft == false
name: Nx Cloud - Agents
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.11.3
with:
number-of-agents: 3
node-version: 16.17.0 # FIXME: use env.NODE_VERSION
affected-recap:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
name: Print affected libs and apps
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3
- name: Install dependencies
run: npm ci
- name: Compute affected projects
run: |
echo "AFFECTED_LIBS=$(npx nx print-affected --type=lib --select=projects | awk 'BEGIN {RS = ", "; ORS = ", "} \
{ print "`"$1"`" }')" >> $GITHUB_ENV
- name: Compute affected apps
run: |
echo "AFFECTED_APPS=$(npx nx print-affected --type=app --select=projects | awk 'BEGIN {RS = ", "; ORS = ", "} \
{ print "`"$1"`" }')" >> $GITHUB_ENV
- name: add PR comment
uses: thollander/actions-comment-pull-request@v2
with:
message: 'Affected libs: ${{ env.AFFECTED_LIBS }}
Affected apps: ${{ env.AFFECTED_APPS }}
- [ ] 🚀 Build and deploy storybook and demo on GitHub Pages
- [ ] 📦 Build and push affected docker images'
comment_tag: build-options
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}