-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #385 from DiamondLightSource/precommit
CI changes, precommit hook
- Loading branch information
Showing
110 changed files
with
1,191 additions
and
904 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
## Checklist | ||
|
||
- [ ] I have opened PR to `dev` branch | ||
- [ ] I have added tests that prove my fix is effective or that my feature works | ||
- [ ] New and existing unit tests pass locally with my changes | ||
- [ ] I have made corresponding changes to the documentation |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: 'PR Tasks Completed Check' | ||
on: | ||
pull_request: | ||
types: [opened, edited] | ||
|
||
jobs: | ||
task-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: kentaro-m/[email protected] | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" |
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
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 | ||
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: 'Check Branch' | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
check_branch: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check branch | ||
if: github.base_ref == 'main' && github.head_ref != 'dev' | ||
run: | | ||
echo "ERROR: You can only merge to main from dev branch." | ||
exit 1 |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Weekly main tests | ||
|
||
on: | ||
schedule: | ||
- cron: '55 0 * * 4' # At 00:55 every Thursday | ||
|
||
jobs: | ||
iris-gpu: | ||
runs-on: iris-gpu | ||
container: | ||
image: nvidia/cuda:11.6.2-devel-ubi8 | ||
env: | ||
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
steps: | ||
- name: Checkout repository code | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: "main" | ||
fetch-depth: 0 | ||
|
||
- 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/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 23.12.1 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
exclude: ^docs/source/examples/ | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: trailing-whitespace # This hook trims trailing whitespace. | ||
- id: check-docstring-first # Checks a common error of defining a docstring after code. | ||
- id: check-merge-conflict # Check for files that contain merge conflict strings. | ||
- id: detect-private-key # Detects the presence of private keys. | ||
- id: check-symlinks | ||
- id: check-toml | ||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: v1.10.0 | ||
hooks: | ||
- id: python-use-type-annotations | ||
- repo: https://github.com/kynan/nbstripout | ||
rev: 0.6.1 | ||
hooks: | ||
- id: nbstripout | ||
exclude: ^docs/source/examples/ | ||
- repo: https://github.com/asottile/blacken-docs | ||
rev: 1.16.0 | ||
hooks: | ||
- id: blacken-docs | ||
- repo: https://github.com/nbQA-dev/nbQA | ||
rev: 1.7.1 | ||
hooks: | ||
- id: nbqa-black |
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
Oops, something went wrong.