Skip to content

Commit

Permalink
#748 GitHub Actions: JS unit testi:
Browse files Browse the repository at this point in the history
- added check_code.yml
- added vitest_tests.yml
- edited incremental-coverage-test.yml
  • Loading branch information
SneakyTurtlle committed Nov 15, 2023
1 parent 26b2973 commit e1cf52a
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 3 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
31 changes: 28 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,32 @@ jobs:
- name: Python unittest
continue-on-error: true
run: |
coverage run -m manage.py 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: vue/dynamicforms/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 }}
if: github.event_name == 'pull_request'

- name: Coverage check on push
uses: velis74/incremental-coverage-check@main
with:
clover_coverage_json: vue/dynamicforms/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

0 comments on commit e1cf52a

Please sign in to comment.