Merge pull request #271 from katalon-studio/master #537
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
- release | |
concurrency: | |
group: test-${{ github.head_ref || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: true | |
matrix: | |
os: | |
- ubuntu-latest | |
node-version: | |
- 20.9.0 | |
steps: | |
- name: Checkout Katalon Agent | |
uses: actions/checkout@v4 | |
- name: Cache | |
id: cache-packages | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} | |
- name: Install packages | |
if: steps.cache-packages.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Run test | |
run: | | |
npm run eslint | |
npm run test:coverage || true | |
sed -i 's@'$GITHUB_WORKSPACE'@/github/workspace/@g' coverage/lcov.info | |
- name: Sonar Cloud Scan | |
uses: SonarSource/[email protected] | |
with: | |
args: > | |
-Dsonar.verbose=true | |
-X | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Run ESLint check | |
uses: sibiraj-s/action-eslint@v3 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
eslint-args: '-c .eslintrc.yml' | |
extensions: 'js' | |
annotations: true |