Skip to content

[QA-750]: Updated startRate and timeUnit in Address CRI #2570

[QA-750]: Updated startRate and timeUnit in Address CRI

[QA-750]: Updated startRate and timeUnit in Address CRI #2570

name: Pre-Merge Lint & Unit Test
on:
pull_request:
types: [opened, synchronize, reopened]
merge_group:
workflow_dispatch:
env:
DOCKER_PATH: ./deploy
TEST_TAG: user/app:test
defaults:
run:
shell: bash
working-directory: ./deploy/scripts
jobs:
k6_unit_test:
name: Run linting and unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: "0"
- name: Setup nodeJS v20
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: 20
- name: Setup python v3.11
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.11"
- name: Install dependencies
run: npm ci
- name: Run linting checks
run: npm run lint
- name: Transpile TypeScript test scripts
run: npm start
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 #v3.8.0
- name: Build Docker Image
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 #v6.13.0
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: ${{ env.DOCKER_PATH }}
load: true
tags: ${{ env.TEST_TAG }}
- name: Run k6 unit test script in image
run: |
docker run --rm ${{ env.TEST_TAG }} -c 'k6 run scripts/common/unit-tests.js'
working-directory: ${{ env.DOCKER_PATH }}
- run: git fetch origin main
- name: Run pre-commit action
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
with:
extra_args: --from-ref FETCH_HEAD --to-ref HEAD