diff --git a/.github/workflows/static-checks.yml b/.github/workflows/static-checks.yml new file mode 100644 index 000000000..defb89181 --- /dev/null +++ b/.github/workflows/static-checks.yml @@ -0,0 +1,37 @@ +name: TypeScript & EsLint & Tests - subdirectories +on: + pull_request: + merge_group: + branches: + - main + push: + # commented out for test purposes + # branches: + # - main +jobs: + static-analysis: + runs-on: ubuntu-latest + strategy: + matrix: {dir: ['parser', 'example', 'WebExample', 'src']} + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 18 + uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Install root node dependencies + run: yarn + - name: Install ${{ matrix.dir }} app node dependencies + if: ${{ matrix.dir != 'example' || matrix.dir != 'src' }} + working-directory: ${{ matrix.dir }} + run: npm ci + - name: Check types + working-directory: ${{ matrix.dir }} + run: npx tsc -p ./tsconfig.json --noEmit + - name: Lint + run: yarn lint:${{ matrix.dir }} + - name: run tests + # no tests inside example and WebExample + if: ${{ matrix.dir != 'example' || matrix.dir != 'WebExample' }} + working-directory: ${{ matrix.dir }} + run: npm run tests