Skip to content

Commit

Permalink
ci: run checks after push to main
Browse files Browse the repository at this point in the history
Note we are not commenting or showing coverage right now
  • Loading branch information
Lewiscowles1986 committed Sep 14, 2024
1 parent 8524d83 commit ce4846f
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/push_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Automated checks (Merged to main)

on:
push:
branches: [ "main" ]
schedule:
- cron: '21 00 * * 2'

jobs:
linting:
name: Lint project
runs-on: ubuntu-latest

permissions:
contents: read
security-events: write
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status

steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Restore dependencies
run: npm ci

- name: setup sarif formatter
run: npm install --no-save @microsoft/eslint-formatter-sarif@3.1.0
- name: Run ESLint
env:
SARIF_ESLINT_IGNORE_SUPPRESSED: "true"
run: npm run lint -- .
--config .eslintrc.json
--ext .js,.jsx,.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: eslint-results.sarif
wait-for-processing: true

tests:
name: Automated Tests
runs-on: ubuntu-latest
permissions:
checks: write
pull-requests: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Restore dependencies
run: npm ci

- name: Run Tests
run: npm test

0 comments on commit ce4846f

Please sign in to comment.