Skip to content

Commit

Permalink
chore: setup ci tests
Browse files Browse the repository at this point in the history
  • Loading branch information
guesant committed Mar 10, 2024
1 parent ea17b93 commit 23ef922
Show file tree
Hide file tree
Showing 6 changed files with 1,648 additions and 679 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/test-estudo-node-z3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Runs tests of estudo-node-z3

on:
push:
branches: [main, development]
pull_request:
branches: [main, development]

jobs:
test:
runs-on: ubuntu-latest

# permissions:
# # Required to checkout the code
# contents: read
# # Required to put a comment into the pull-request
# pull-requests: write

strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install deps
run: npm ci
- name: 'Test'
working-directory: ./estudo-node-z3/projeto
run: npm run coverage
- name: 'Report Coverage'
# Set if: always() to also generate the report if tests are failing
# Only works if you set `reportOnFailure: true` in your vite config as specified above
if: always()
with:
working-directory: ./estudo-node-z3/projeto
uses: davelosert/vitest-coverage-report-action@v2
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
coverage

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
Expand Down
1 change: 1 addition & 0 deletions estudo-node-z3/projeto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
},
"devDependencies": {
"@types/lodash": "^4.14.202",
"@vitest/coverage-v8": "^1.3.1",
"typescript": "^5.4.2",
"vitest": "^1.3.1"
}
Expand Down
10 changes: 10 additions & 0 deletions estudo-node-z3/projeto/vitest.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'vitest/config'

export default defineConfig({
test: {
coverage: {
reporter: ['json-summary'],
reportOnFailure: true,
}
}
})
Loading

0 comments on commit 23ef922

Please sign in to comment.