chore: Add prek to testing workflows and frontend files #83
Workflow file for this run
This file contains hidden or 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: Vitest | |
| # yamllint disable-line rule:truthy | |
| on: | |
| push: | |
| branches: [beta, main] | |
| paths: | |
| - "**.ts" | |
| - "lovelace_strategy/**" | |
| - "package.json" | |
| - "vitest.config.ts" | |
| pull_request: | |
| branches: [beta, main] | |
| paths: | |
| - "**.ts" | |
| - "lovelace_strategy/**" | |
| - "package.json" | |
| - "vitest.config.ts" | |
| jobs: | |
| prek: | |
| runs-on: ubuntu-latest | |
| name: Prek | |
| steps: | |
| - name: 📥 Checkout the repository | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: 🛠️ Set up Node | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: "lts/iron" | |
| - name: 📦 Install dependencies | |
| run: yarn install | |
| - name: 🔍 Run prek | |
| uses: j178/prek-action@6ad80277337ad479fe43bd70701c3f7f8aa74db3 # v2.0.3 | |
| with: | |
| extra-args: --all-files | |
| test: | |
| needs: prek | |
| name: TypeScript Test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: | |
| - "lts/iron" | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Set up Node ${{ matrix.node-version }} | |
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install dependencies | |
| run: yarn install | |
| - name: Run tests and generate coverage report | |
| run: yarn test --coverage --coverage.reporter=json | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@75cd11691c0faa626561e295848008c8a7dddffe # v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: typescript | |
| files: ./coverage/coverage-final.json |