Skip to content

SYS-164 added workflow to run linter and trigger smoke tests #12

SYS-164 added workflow to run linter and trigger smoke tests

SYS-164 added workflow to run linter and trigger smoke tests #12

Workflow file for this run

name: Typescript CI Workflow
on:
push:
branches:
- dev
pull_request:
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
echo "Installing dependencies..."
npm ci
echo "Dependency installation complete."
- name: Build
run: |
echo "Compiling the code..."
npm run compile
echo "Compile complete."
- name: Lint
run: |
echo "Running Linter..."
npm run lint
echo "Running Linter complete."
- name: Format check
run: |
echo "Running format check..."
npm run format-check
echo "Format check complete."
- name: Test apply patches
run: |
set -e
for patch in *.patch; do
if [ -f "$patch" ]; then
echo "Testing $patch"
git apply --check -v "$patch" || (echo "Failed to apply patch: $patch" && exit 1)
fi
done
echo "No patches to test or all patches applied successfully."
trigger-jenkins:
needs: build
runs-on: ubuntu-latest
steps:
- name: Set Branch Name
id: vars
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
else
echo "BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
fi
- name: Trigger Jenkins Job
run: |
curl -f -X POST "${{ secrets.JENKINS_URL }}/job/${{ secrets.JENKINS_JOB_NAME_SMOKE_10_X_10 }}/buildWithParameters?SPECIFY_SHARDUS_TYPES_BRANCH=true&SHARDUS_TYPES_BRANCH=${BRANCH_NAME}" \
--user "${{ secrets.JENKINS_API_CREDS }}"