diff --git a/.github/workflows/test_base.yml b/.github/workflows/test_base.yml new file mode 100644 index 0000000..2e9d2f6 --- /dev/null +++ b/.github/workflows/test_base.yml @@ -0,0 +1,39 @@ +name: Build & test + +on: + workflow_call: + +jobs: + test: + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install + run: | + pip install coverage + pip install -r requirements_test.txt + pip install -e . + + - name: Run tests with coverage + run: | + coverage run --source flowio run_tests.py + coverage xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: coverage.xml + fail_ci_if_error: true + verbose: true diff --git a/.github/workflows/tests_develop.yml b/.github/workflows/tests_develop.yml index 3941768..e79e202 100644 --- a/.github/workflows/tests_develop.yml +++ b/.github/workflows/tests_develop.yml @@ -4,37 +4,10 @@ on: push: branches: - develop + pull_request: + branches: + - develop jobs: test: - runs-on: ubuntu-latest - - strategy: - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10"] - - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: 'develop' - - - name: Setup Python - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - run: pip install coverage - - run: pip install -r requirements_test.txt - - - name: Run tests with coverage - run: | - coverage run --source flowio --omit="flowio/tests/*" run_tests.py - coverage xml - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - files: coverage.xml - fail_ci_if_error: true - verbose: true + uses: whitews/FlowIO/.github/workflows/test_base.yml@develop \ No newline at end of file