name: CI

on:
  push:
  pull_request:
    types: [opened, reopened]

concurrency:
  group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
  cancel-in-progress: true


jobs:
  Security:
    name: Security Pipeline
    uses: uc-cdis/.github/.github/workflows/securitypipeline.yaml@master
    with:
      python-poetry: 'false'
    secrets: inherit

  ci:
    name: Build Image and Push
    uses: uc-cdis/.github/.github/workflows/image_build_push_native.yaml@master
    secrets:
      ECR_AWS_ACCESS_KEY_ID: ${{ secrets.ECR_AWS_ACCESS_KEY_ID }}
      ECR_AWS_SECRET_ACCESS_KEY: ${{ secrets.ECR_AWS_SECRET_ACCESS_KEY }}
      QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
      QUAY_ROBOT_TOKEN: ${{ secrets.QUAY_ROBOT_TOKEN }}

  unit_test:
    name: NPM Unit Test
    uses: uc-cdis/.github/.github/workflows/npm_unit_test.yaml@master
    with:
      node-version: '24'
      npm-version: '11'
      pre-test: 'COMMIT=`git rev-parse HEAD` && echo "export const gitCommit = \"${COMMIT}\";" >server/version.js && VERSION=`git describe --always --tags` && echo "export const gitVersion =\"${VERSION}\";" >>server/version.js'
      post-test: 'npm run eslint'
