Skip to content

Commit

Permalink
Create GitHub action for running the tests in forked repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
AnaCaceres committed Feb 12, 2024
1 parent 55ffa11 commit 8e914de
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/fork-run-pytest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run pytest for Forked projects

on:
push:
branches:
- '**'
pull_request:
types: [opened, synchronize, reopened, edited]
branches:
- develop
- main

concurrency:
group: fork-run-pytest-tests_${{ github.ref }}
cancel-in-progress: true

jobs:
run-pytest:
if: ${{ github.event.repository.fork }}
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0

- name: Run tests
run: docker run --rm -v $PWD:/home/sage/tii-claasp tiicrc/claasp-base:latest make github-pytest
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ remote-pytest:
pytest:
pytest -v -n=auto --dist loadfile tests/unit/

github-pytest:
pytest -v tests/unit/

pytest-coverage:
pytest -v -n=2 --dist loadfile --cov-report term-missing --cov=$(PACKAGE) tests/unit/

Expand Down

0 comments on commit 8e914de

Please sign in to comment.