diff --git a/.github/workflows/check_code.yml b/.github/workflows/check_code.yml new file mode 100644 index 00000000..2a549b21 --- /dev/null +++ b/.github/workflows/check_code.yml @@ -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 diff --git a/.github/workflows/incremental-coverage-test.yml b/.github/workflows/incremental-coverage-test.yml index 2266ba5b..4315bbcf 100644 --- a/.github/workflows/incremental-coverage-test.yml +++ b/.github/workflows/incremental-coverage-test.yml @@ -1,5 +1,5 @@ name: Coverage check -on: [pull_request] +on: [push, pull_request] jobs: lint: name: Code coverage @@ -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: @@ -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' diff --git a/.github/workflows/vitest_tests.yml b/.github/workflows/vitest_tests.yml new file mode 100644 index 00000000..2f930e82 --- /dev/null +++ b/.github/workflows/vitest_tests.yml @@ -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