pre-commit #169
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: Commit check | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
defaults: | |
run: | |
# micromamba activation | |
shell: bash -l -eo pipefail {0} | |
jobs: | |
files-check: | |
runs-on: [self-hosted, ubuntu-latest] | |
container: | |
image: ghcr.io/catthehacker/ubuntu:act-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Add SSH key for private repos | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Create build environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: ./environment-dev.yml | |
environment-name: test_env | |
- name: Run precommit | |
run: | | |
pre-commit run --all-files | |
run-test: | |
runs-on: [self-hosted, ubuntu-latest] | |
container: | |
image: ghcr.io/catthehacker/ubuntu:act-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Add SSH key for private repos | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Create build environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: ./environment-dev.yml | |
environment-name: test_env | |
- name: Test with pytest | |
run: | | |
python -m pytest |