Thanks to visit codestin.com
Credit goes to github.com

Skip to content

release(template): 19.2.2 #4893

release(template): 19.2.2

release(template): 19.2.2 #4893

name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
# Group concurrency on workflow, then:
# - Is merge run? Group on branch name (`refs/heads/main`)
# - Is pull request? Group on pull request branch name, for example `feat/add-awesome-feature`
group: >-
${{ github.workflow }}-${{
github.event_name == 'push'
&& github.ref
|| github.head_ref
}}
# Run merge workflows in sequence to prevent parallel deployments and releases
# Cancel stale pull request runs in progress for the same branch
cancel-in-progress: ${{ github.event_name != 'push' }}
env:
NODE_OPTIONS: --max-old-space-size=6144
docs-name: docs
docs-path: dist/apps/docs
NX_BRANCH: ${{ github.event.number || github.ref_name }}
permissions:
actions: read
contents: read
jobs:
main:
name: Main CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout [Pull Request]
if: ${{ github.event_name == 'pull_request' }}
with:
# By default, PRs will be checked-out based on the Merge Commit, but we want the actual branch HEAD.
ref: ${{ github.event.pull_request.head.sha }}
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
- uses: actions/checkout@v4
name: Checkout [Default Branch]
if: ${{ github.event_name != 'pull_request' }}
with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v4
- name: Initialize the Nx Cloud distributed CI run
run: npx nx-cloud start-ci-run --distribute-on="./nx/workflows/dynamic-changesets.yml" --stop-agents-after="e2e" --require-explicit-completion
- name: Set up dependencies
uses: ./.github/actions/setup
- name: Run commands in parallel
run: |
npx nx-cloud record -- npx nx format:check
npx nx affected -t lint build test component-test e2e --parallel=4 --exclude=docs
npx nx-cloud complete-ci-run
# Upload coverage reports to Codecov
- name: Upload coverage
if: steps.test.outcome == 'success'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/state/lcov.info, coverage/template/lcov.info, coverage/cdk/lcov.info, coverage/isr/lcov.info, coverage/eslint-plugin/lcov.info
flags: state, template, cdk, isr, eslint-plugin
# The docs project is built in a separate job because it requires Node.js 16
build-docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Checkout all commits
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up dependencies
uses: ./.github/actions/setup
- name: Build docs
run: yarn nx build docs
- name: '[Merge] Upload docs'
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: ${{ env.docs-name }}
path: ${{ env.docs-path }}
deploy-docs:
name: '[Merge] Deploy docs'
runs-on: ubuntu-latest
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
if: github.ref == 'refs/heads/main'
# Deploy to the github-pages environment
environment:
name: github-pages
url: www.rx-angular.io
#url: ${{ steps.deployment.outputs.page_url }}
needs: [build-docs]
steps:
- name: Download docs
uses: actions/download-artifact@v4
with:
name: ${{ env.docs-name }}
path: ${{ env.docs-path }}
- name: Set up GitHub Pages
uses: actions/configure-pages@v4
- name: Upload docs to GitHub Pages
uses: actions/upload-pages-artifact@v1
with:
path: ${{ env.docs-path }}
- name: Deploy docs to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1