Added tests workflow to release workflow and bumped dev version in binops plugin #4
Workflow file for this run
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: Package tests | |
on: | |
pull_request: | |
branches: | |
- main | |
- master | |
- dev | |
workflow_call: | |
outputs: | |
package_dir: | |
description: "The directory containing the updated package" | |
value: ${{ jobs.package-filter.outputs.package_dir }} | |
package_name: | |
description: "The name of the updated package" | |
value: ${{ jobs.package-filter.outputs.package_name }} | |
permissions: | |
contents: read | |
jobs: | |
package-filter: | |
name: Filter for updated package | |
uses: ./.github/workflows/package-filter.yml | |
package-tests: | |
name: Run the tests for updated packages. | |
runs-on: ubuntu-latest | |
needs: package-filter | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install Poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Install package | |
run: | | |
cd ${{ needs.package-filter.outputs.package_dir }} | |
poetry install --no-interaction | |
- name: Run pre-commit hooks | |
run: | | |
cd ${{ needs.package-filter.outputs.package_dir }} | |
poetry run pre-commit run --files ./**/** | |
if [[ $(git status --porcelain) ]] | |
then | |
echo "::error::pre-commit hooks failed" && exit 1 | |
fi | |
- name: Run tests | |
run: | | |
cd ${{ needs.package-filter.outputs.package_dir }} | |
poetry run pytest -v |