Skip to content

Create new admin-operator flow #162

Create new admin-operator flow

Create new admin-operator flow #162

Workflow file for this run

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: CI/CD
on:
push:
branches: ['master']
pull_request:
branches: ['master']
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.12.1
cache: 'npm'
- name: Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Determine Base Branch
id: base_branch
run: echo "branch=$(if [ '${{ github.ref }}' = 'refs/heads/master' ]; then echo 'master~1'; else echo 'origin/master'; fi)" >> $GITHUB_OUTPUT
- run: npm run nx -- format:check --base ${{ steps.base_branch.outputs.branch }}
- run: npm run nx -- affected --target lint --base ${{ steps.base_branch.outputs.branch }}
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.12.1
cache: 'npm'
- name: Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Determine Base Branch
id: base_branch
run: echo "branch=$(if [ '${{ github.ref }}' = 'refs/heads/master' ]; then echo 'master~1'; else echo 'origin/master'; fi)" >> $GITHUB_OUTPUT
- run: npm run nx -- affected --target build --base ${{ steps.base_branch.outputs.branch }}
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20.12.1
cache: 'npm'
- name: Cache dependencies
id: cache
uses: actions/cache@v4
with:
path: ./node_modules
key: modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Determine Base Branch
id: base_branch
run: echo "branch=$(if [ '${{ github.ref }}' = 'refs/heads/master' ]; then echo 'master~1'; else echo 'origin/master'; fi)" >> $GITHUB_OUTPUT
- run: npm run nx -- affected --target test --base ${{ steps.base_branch.outputs.branch }}