Overhaul PyDesigner Code 2 #38
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: CI | |
on: | |
pull_request: | |
push: | |
branches: master | |
tags: | |
- "**" | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GH_BRIDGE_PAT }} | |
- name: Set up Python | |
id: setup-python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
architecture: 'x64' | |
- name: Run Pre-Commit | |
id: pre-commit | |
uses: pre-commit/[email protected] | |
continue-on-error: true | |
with: | |
extra_args: --all-files | |
- name: Auto-commit changed files | |
id: git-auto-commit | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "Pre-commit autofix" | |
- name: Return pre-commit response | |
if: steps.pre-commit.outcome == 'failure' | |
run: exit 1 | |
pytest: | |
needs: pre-commit | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
id: checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_BRIDGE_PAT }} | |
- name: Setup QEMU | |
id: qemu | |
uses: docker/setup-qemu-action@v3 | |
- name: Setup Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
id: login | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# - name: Expose GitHub Runtime | |
# uses: crazy-max/ghaction-github-runtime@v3 | |
- name: Build Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
load: true | |
push: false | |
file: tests/Dockerfile | |
tags: pydesigner-test | |
- name: Run tests in Docker container | |
run: docker run pydesigner-test | |
- name: Copy test results | |
run: docker cp pydesigner-test:/test_results/ ./test_results | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: ./test_results/results.xml | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: ./test_results/coverage.xml | |
- name: Clean up | |
run: docker rm test-container |