This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
Update README.md #489
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-as-lint | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- ready_for_review | |
jobs: | |
get-dirs: | |
if: github.event_name == 'pull_request' | |
name: Get Directories | |
runs-on: ubuntu-latest | |
outputs: | |
dirs: ${{ steps.get-dirs.outputs.dirs }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Get subdirectories | |
id: get-dirs | |
# we need to lint the src directory and all the examples | |
run: echo "dirs=$(ls -d examples/*/ | jq -Rsc '["src/"] + split("\n")[:-1]' )" >> ${GITHUB_OUTPUT} | |
as-lint: | |
needs: get-dirs | |
if: github.event_name == 'pull_request' | |
name: Lint | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
dir: ${{ fromJson(needs.get-dirs.outputs.dirs) }} | |
defaults: | |
run: | |
working-directory: ${{ matrix.dir }} | |
steps: | |
- name: Checkout Source | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ">=20" | |
- name: Install dependencies | |
working-directory: src/ | |
run: npm install | |
- name: Install additional dependencies | |
if: ${{ matrix.dir != 'src/' }} | |
run: npm install | |
- name: Validate code is formatted | |
run: npm run pretty:check | |
- name: Valid code is linted | |
run: npm run lint |