Skip to content

code review changes #1361

code review changes

code review changes #1361

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- '**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
permissions:
contents: write
actions: read
jobs:
lint:
runs-on: ubuntu-latest
permissions:
contents: "read"
actions: "read"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: yarn
- name: corepack enable
shell: bash
run: corepack enable
- name: install dependencies
shell: bash
run: yarn install
- name: setup nx shas
uses: nrwl/nx-set-shas@v4
- name: lint
run: yarn nx affected --target lint
env:
NXCACHE_MINIO_ACCESS_KEY: ${{ secrets.NXCACHE_MINIO_ACCESS_KEY }}
NXCACHE_MINIO_SECRET_KEY: ${{ secrets.NXCACHE_MINIO_SECRET_KEY }}
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-24.04
arch: amd64
- os: ubuntu-24.04
arch: arm64
permissions:
contents: "read"
actions: "read"
steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 100
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: yarn
- name: Docker Setup
uses: ./.github/actions/setup-docker
with:
docker-username: ${{ secrets.DOCKERHUB_USERNAME }}
docker-password: ${{ secrets.DOCKERHUB_TOKEN }}
harbor-username: ${{ secrets.HARBOR_USERNAME }}
harbor-password: ${{ secrets.HARBOR_TOKEN }}
- name: corepack enable
shell: bash
run: corepack enable
- name: install dependencies
shell: bash
run: yarn install
- name: setup nx shas
uses: nrwl/nx-set-shas@v4
- run: |
echo "BASE: ${{ env.NX_BASE }}"
echo "HEAD: ${{ env.NX_HEAD }}"
- name: test
run: yarn nx affected --target test --parallel 2
env:
NXCACHE_MINIO_ACCESS_KEY: ${{ secrets.NXCACHE_MINIO_ACCESS_KEY }}
NXCACHE_MINIO_SECRET_KEY: ${{ secrets.NXCACHE_MINIO_SECRET_KEY }}
build:
runs-on: ubuntu-latest
permissions:
contents: "read"
actions: "read"
if: github.ref == 'refs/heads/main'
needs:
- lint
- test
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: package.json
cache: yarn
- name: Docker Setup
uses: ./.github/actions/setup-docker
with:
docker-username: ${{ secrets.DOCKERHUB_USERNAME }}
docker-password: ${{ secrets.DOCKERHUB_TOKEN }}
harbor-username: ${{ secrets.HARBOR_USERNAME }}
harbor-password: ${{ secrets.HARBOR_TOKEN }}
- name: corepack enable
shell: bash
run: corepack enable
- name: install dependencies
shell: bash
run: yarn install
- name: setup nx shas
uses: nrwl/nx-set-shas@v4
- name: Build & Push Docker Image
run: yarn nx affected --target docker-push
env:
NXCACHE_MINIO_ACCESS_KEY: ${{ secrets.NXCACHE_MINIO_ACCESS_KEY }}
NXCACHE_MINIO_SECRET_KEY: ${{ secrets.NXCACHE_MINIO_SECRET_KEY }}