Skip to content

Commit

Permalink
ci(build): fix the ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
bsahitya committed May 15, 2024
1 parent 7583cbf commit d46468b
Showing 1 changed file with 45 additions and 34 deletions.
79 changes: 45 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,72 @@
name: CI
name: Teradata web design system CI

on:
push:
branches:
- main
pull_request:
branches: '*'
branches: [main, beta]

permissions:
actions: read
contents: read
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

jobs:
quality:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run format:check -- --base=${{ github.event.pull_request.base.sha }}
- run: npx nx affected --target=scsslint --base=${{ github.event.pull_request.base.sha }}
- run: npx nx affected --target=lint --base=${{ github.event.pull_request.base.sha }}

# Connect your workspace on nx.app and uncomment this to enable task distribution.
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
test:
runs-on: ubuntu-latest

# Cache node_modules
- uses: actions/setup-node@v3
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache: npm
- run: npm ci
- uses: nrwl/nx-set-shas@v4

# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: npx nx-cloud record -- echo Hello World
- run: npx nx affected -t lint test build e2e-ci
- run: npx nx affected --target=test --base=${{ github.event.pull_request.base.sha }}

publish:
e2e:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
if: ${{ github.ref == 'refs/heads/main' }}
needs: [quality]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js 20
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache: npm
- run: npm ci
- uses: nrwl/nx-set-shas@v4
- run: NODE_OPTIONS=--max_old_space_size=4096 npx nx affected --target=e2e --base=${{ github.event.pull_request.base.sha }}

build:
runs-on: ubuntu-latest

- run: npm run semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GH }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npx nx affected --target=build --base=${{ github.event.pull_request.base.sha }}
- run: npx nx affected --target=build-scss --base=${{ github.event.pull_request.base.sha }}

0 comments on commit d46468b

Please sign in to comment.