Skip to content

Commit

Permalink
#748 - GitHub Actions: JS unit testi: (#172)
Browse files Browse the repository at this point in the history
* #748 GitHub Actions: JS unit testi:
- added check_code.yml
- added vitest_tests.yml
- edited incremental-coverage-test.yml

* #748 GitHub Actions: JS unit testi:
- npm install

* #748 GitHub Actions: JS unit testi:
- removed: clover_coverage_json: vue/dynamicforms/coverage/coverage-final.json

* #748 GitHub Actions: JS unit testi:
- added: clover_coverage_json: vue/coverage/coverage-final.json

* Test coverage

* Coverage DEBUG

* Coverage INFO

* PR number

* #748 GitHub Actions: JS unit testi:
- added console.log('Hello'); to test .ts

* #748 GitHub Actions: JS unit testi:
- removed console.log('Hello'); from .ts file

* #748 GitHub Actions: JS unit testi:
- testing .ts

* #748 GitHub Actions: JS unit testi:
- undo testing .ts

---------

Co-authored-by: Uros Tement <ut@scantron.si>
  • Loading branch information
SneakyTurtlle and utement authored Nov 20, 2023
1 parent 70baaf0 commit 469640e
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/check_code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Python check code

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python: [3.8, 3.9]

steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install Tox and any other packages
run: |
pip install tox
- name: Run Tox
run: tox -e check
32 changes: 29 additions & 3 deletions .github/workflows/incremental-coverage-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Coverage check
on: [pull_request]
on: [push, pull_request]
jobs:
lint:
name: Code coverage
Expand All @@ -8,6 +8,16 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.13.0'
- name: Install Dependencies
run: npm ci
- name: Test build
run: npm run build-no-tsc --if-present
- name: Run tests
run: npm test
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
Expand All @@ -19,17 +29,33 @@ jobs:
- name: Python unittest
continue-on-error: true
run: |
coverage run -m manage test
coverage run -m unittest discover tests/
- name: Generate coverage report
continue-on-error: true
run: |
coverage report -m
coverage json
- uses: velis74/incremental-coverage-check@main
- name: Coverage check on pull_request
uses: velis74/incremental-coverage-check@main
with:
clover_coverage_json: coverage/coverage-final.json
py_coverage_json: coverage.json
logging_level: INFO
base_ref: ${{ github.base_ref }}
head_ref: HEAD
rep_ref: main
gh_token: ${{ secrets.GITHUB_TOKEN }}
pr_number: ${{github.event.pull_request.number}}
if: github.event_name == 'pull_request'

- name: Coverage check on push
uses: velis74/incremental-coverage-check@main
with:
clover_coverage_json: coverage/coverage-final.json
py_coverage_json: coverage.json
logging_level: INFO
base_ref: ${{ github.event.before }}
head_ref: HEAD
rep_ref: main
if: github.event_name == 'push'
20 changes: 20 additions & 0 deletions .github/workflows/vitest_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Vitest Tests
on: [push]

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.13.0'
- name: Install Dependencies
run: npm ci
- name: Test build
run: npm run build-no-tsc --if-present
- name: Run tests
run: npm test
2 changes: 1 addition & 1 deletion vue/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ class Store {
}
}

export { Store };
export { Store };

Check failure on line 31 in vue/store.ts

View workflow job for this annotation

GitHub Actions / Code coverage

Newline required at end of file but not found

Check failure on line 31 in vue/store.ts

View workflow job for this annotation

GitHub Actions / build

Newline required at end of file but not found

Check failure on line 31 in vue/store.ts

View workflow job for this annotation

GitHub Actions / Code coverage

Newline required at end of file but not found

Check failure on line 31 in vue/store.ts

View workflow job for this annotation

GitHub Actions / build

Newline required at end of file but not found

0 comments on commit 469640e

Please sign in to comment.