diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..685083c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,35 @@ +--- +name: Lint and test workflow +on: + push: + branches: ['*', '!push-action/*'] + pull_request: + branches: ['*', '!push-action/*'] +jobs: + quality: + name: Lint code + if: github.event.pull_request.merged == false + runs-on: ubuntu-latest + steps: + - name: Setup Python environment + uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@v0.3.6 + with: + python-version: '3.10' + - name: snakemake lint + run: poetry run snakemake --lint + - name: snakefmt + run: poetry run snakefmt --check workflow + test: + runs-on: ubuntu-latest + needs: [quality] + strategy: + matrix: + python-version: ['3.8', '3.9', '3.10', '3.11'] + steps: + - name: Setup Python environments + uses: khanlab/actions/.github/actions/action-setup_task-installPyProject@v0.3.6 + with: + python-version: ${{ matrix.python-version }} + install-library: true + - name: Integration dry-run test + run: poetry run snakemake -np