Add instructions for correct usage of setup_miniconda.sh. #283
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: Create new project and run tests etc. | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '*' | |
jobs: | |
new-project: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11.0 | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
miniconda-version: "latest" | |
channels: conda-forge | |
channel-priority: flexible | |
show-channel-urls: true | |
- name: Create blueprint run env from unpinned reqs | |
run: | | |
conda env create --name blueprint --file requirements/requirements.yml | |
- name: Create new project | |
run: | | |
# Note: Make sure python_version is consistent with python-version hardcoded above | |
conda run --name blueprint copier --force --vcs-ref=HEAD --data python_version=3.9 copy . flying_circus | |
- name: Prepare new project | |
working-directory: ./flying_circus | |
run: | | |
git init | |
git config user.name "Monty Python" | |
git config user.email "[email protected]" | |
git add . | |
git commit -m "initial commit" | |
- name: Create env (unpinned) and install package | |
working-directory: ./flying_circus | |
run: | | |
bash tools/setup_env.sh -u | |
conda run --name flying-circus python -m pip install --no-deps . | |
- name: Run pre-commit hooks | |
working-directory: ./flying_circus | |
run: | | |
conda run --name flying-circus pre-commit install-hooks | |
conda run --name flying-circus pre-commit run --all-files | |
- name: Run formatters | |
working-directory: ./flying_circus | |
run: | | |
conda run --name flying-circus black . | |
conda run --name flying-circus isort . | |
- name: Run type checker | |
working-directory: ./flying_circus | |
run: | | |
conda run --name flying-circus tools/run-mypy.sh | |
- name: Run linters | |
working-directory: ./flying_circus | |
run: | | |
conda run --name flying-circus pydocstyle | |
conda run --name flying-circus flake8 | |
conda run --name flying-circus pylint src tests | |
- name: Run unit tests | |
working-directory: ./flying_circus | |
run: | | |
conda run --name flying-circus pytest |