From dc03b9b877266a9fb0ff434a607d2ed5e52f3c4f Mon Sep 17 00:00:00 2001 From: Robert Kozik Date: Thu, 18 Jan 2024 16:14:58 +0100 Subject: [PATCH] create static check github action for src, parser and examples --- .github/workflows/static-checks.yml | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/static-checks.yml 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