ci: run test and validate jobs in same workflow (#42) #5
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: main | |
on: | |
# push trigger required to get coveralls monitoring of default branch | |
# pull_request required to get PR coveralls comments | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
changed-files: | |
runs-on: ubuntu-latest | |
outputs: | |
any_ts_changed: ${{ steps.changed-files.outputs.any_changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: tj-actions/changed-files@v44 | |
id: changed-files | |
with: | |
files: | | |
{src,test}/**/*.ts | |
package.json | |
tsconfig.json | |
test: | |
needs: changed-files | |
if: needs.changed-files.outputs.any_ts_changed == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: oven-sh/setup-bun@v1 | |
- run: bun install | |
- run: bun test --coverage --coverage-reporter lcov --coverage-dir . | |
- name: Coveralls | |
uses: coverallsapp/[email protected] | |
with: | |
format: lcov | |
file: lcov.info | |
validate: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: oven-sh/setup-bun@v2 | |
- run: bun install | |
- name: Validate | |
run: | | |
bun concurrently \ | |
-c auto \ | |
-n format,lint,typecheck \ | |
'bun dprint check' \ | |
'bun biome check --config-path=.biome.jsonc .' \ | |
'bun tsc' |