-
Notifications
You must be signed in to change notification settings - Fork 6
45 lines (42 loc) · 1.09 KB
/
check_code.yaml
File metadata and controls
45 lines (42 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Code quality
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
schedule:
- cron: "0 3 * * *" # time zone is UTC
jobs:
fourc-webviewer-code-check:
name: Code check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up virtual environment
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
conda-remove-defaults: true
channels: conda-forge
activate-environment: 4c-webviewer
python-version: 3.12
- name: Install requirements
shell: bash -el {0}
run: |
conda activate 4c-webviewer
pip install -e .
pip install pre-commit
- name: Run code-checks
shell: bash -el {0}
run: |
conda activate 4c-webviewer
if [ "${GITHUB_REF}" = "refs/heads/main" ]; then
SKIP=no-commit-to-branch pre-commit run --all-files
else
pre-commit run --all-files
fi