Feature/GitHub actions only changed files test #3646
Workflow file for this run
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: CI Tests | |
# Pull request will trigger when PR is opened or updated, and more (https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request) | |
# Thus limit push checks to master branch so things run after the PR is merged. Without the limit multiple actions run on each PR | |
on: | |
pull_request: | |
push: | |
branches: | |
- 'master' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Get all history for all branches and tags, so changed files can be found | |
fetch-depth: 0 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Setup | |
run: npm ci | |
- name: Run eslint on changed files | |
# Always run both eslint and prettier | |
if: always() | |
# Ref https://github.com/tj-actions/eslint-changed-files | |
uses: tj-actions/eslint-changed-files@v25 | |
with: | |
config_path: 'eslint.config.mjs' | |
extra_args: '--max-warnings=0' | |
- name: Run Prettier on changed files | |
# Always run both eslint and prettier | |
if: always() | |
uses: ./.github/actions/prettier | |
with: | |
fail_on_error: true | |
filter_mode: file | |
level: warning | |
prettier_flags: '**/*.{js,jsx,ts,tsx}' | |
reporter: github-pr-check | |
- name: Build | |
run: npm run ci-build |