Apply black formatting to the codebase and add enforced status checks on PRs before merging #2
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: HTTomo dev build | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-conda-upload: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout repository code | |
uses: actions/checkout@v3 | |
with: | |
ref: "dev" | |
fetch-depth: 0 | |
# setup Python 3.10 | |
- name: Setup Python 3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies with Conda | |
run: | | |
$CONDA/bin/conda install -c conda-forge conda-build | |
$CONDA/bin/conda install -c conda-forge anaconda-client | |
$CONDA/bin/conda update conda | |
$CONDA/bin/conda update conda-build | |
$CONDA/bin/conda list | |
- name: Decrypt a secret | |
run: ./.scripts/decrypt_secret.sh | |
env: | |
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }} | |
- name: Build and upload the package (dev) to httomo conda cloud | |
env: | |
LABEL: dev | |
run: | | |
chmod +x ./.scripts/conda_upload.sh | |
./.scripts/conda_upload.sh | |
run: exit 0 | |
install-run-tests: | |
runs-on: ubuntu-latest | |
needs: build-conda-upload | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Checkout repository code | |
uses: actions/checkout@v3 | |
# setup Python 3.10 | |
- name: Setup Python 3.10 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Create conda environment | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: conda/environment.yml | |
environment-name: httomo | |
post-cleanup: 'all' | |
init-shell: bash | |
- name: Install httomo | |
run: | | |
conda install "httomo/linux-64::httomo * py310_openmpi_regular*" | |
micromamba list | |
- name: Run tests | |
run: | | |
pytest tests/ | |
run: exit 0 | |