Skip to content

pre-commit

pre-commit #169

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