Skip to content

ci: add go-junit-report #24

ci: add go-junit-report

ci: add go-junit-report #24

Workflow file for this run

name: Lint
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: '36 15 * * 5'
permissions:
contents: read
security-events: write
actions: read
packages: read
checks: write
jobs:
eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '21'
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
standalone: true
package_json_file: 'ui/package.json'
version: latest
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
working-directory: ./ui
run: pnpm install
- name: Run ESLint
working-directory: ./ui
run: >-
pnpm eslint .
--ext ".ts,.tsx"
--format @microsoft/eslint-formatter-sarif
--output-file eslint-results.sarif
continue-on-error: true
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ./ui/eslint-results.sarif
wait-for-processing: true
golangci-lint:
name: GolangCI Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
args: '--out-format=colored-line-number,sarif:golangci-lint-results.sarif'
continue-on-error: true
# fixme: remove this after https://github.com/golangci/golangci-lint/pull/4758 merged
- name: Workaround to fix the issue with golangci-lint sarif output
run: |
jq '(.runs[] | select(.results == null) | .results) = []' golangci-lint-results.sarif > tmp.sarif
mv tmp.sarif golangci-lint-results.sarif
- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: ./golangci-lint-results.sarif
wait-for-processing: true