@@ -8,16 +8,16 @@ name: Test schematic
88on :
99 push :
1010 branches : ['main']
11- pull_request :
11+ pull_request :
1212 branches : ['*']
1313 workflow_dispatch : # Allow manually triggering the workflow
1414concurrency :
15- # cancel the current running workflow from the same branch, PR when a new workflow is triggered
15+ # cancel the current running workflow from the same branch, PR when a new workflow is triggered
1616 # when the trigger is not a PR but a push, it will use the commit sha to generate the concurrency group
1717 # {{ github.workflow }}: the workflow name is used to generate the concurrency group. This allows you to have more than one workflows
18- # {{ github.ref_type }}: the type of Git ref object created in the repository. Can be either branch or tag
19- # {{ github.event.pull_request.number}}: get PR number
20- # {{ github.sha }}: full commit sha
18+ # {{ github.ref_type }}: the type of Git ref object created in the repository. Can be either branch or tag
19+ # {{ github.event.pull_request.number}}: get PR number
20+ # {{ github.sha }}: full commit sha
2121 # credit: https://github.com/Sage-Bionetworks-Workflows/sagetasks/blob/main/.github/workflows/ci.yml
2222 group : >-
2323 ${{ github.workflow }}-${{ github.ref_type }}-
@@ -27,16 +27,16 @@ jobs:
2727 test :
2828 runs-on : ubuntu-latest
2929 env :
30- POETRY_VERSION : 1.2.0rc1
30+ POETRY_VERSION : 1.2.0
3131 strategy :
3232 fail-fast : false
3333 matrix :
34- python-version : ["3.7", "3.8", "3. 9", "3.10"]
34+ python-version : ["3.9", "3.10"]
3535
3636 steps :
3737
3838 # ----------------------------------------------
39- # check-out repo and set-up python
39+ # check-out repo and set-up python
4040 # ----------------------------------------------
4141 - name : Check out repository
4242 uses : actions/checkout@v2
@@ -45,19 +45,18 @@ jobs:
4545 uses : actions/setup-python@v2
4646 with :
4747 python-version : ${{ matrix.python-version }}
48-
48+
4949 # ----------------------------------------------
50- # install & configure poetry
50+ # install & configure poetry
5151 # ----------------------------------------------
5252 - name : Install Poetry
5353 run : |
5454 curl -sSL https://install.python-poetry.org \
5555 | python3 - --version ${{ env.POETRY_VERSION }};
56- poetry config virtualenvs.create true;
57- poetry config virtualenvs.in-project true;
58-
56+ poetry config virtualenvs.create true;
57+ poetry config virtualenvs.in-project true;
5958 # ----------------------------------------------
60- # load cached venv if cache exists
59+ # load cached venv if cache exists
6160 # ----------------------------------------------
6261 - name : Load cached venv
6362 id : cached-poetry-dependencies
@@ -67,21 +66,21 @@ jobs:
6766 key : venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
6867
6968 # ----------------------------------------------
70- # install dependencies if cache does not exist
69+ # install dependencies if cache does not exist
7170 # ----------------------------------------------
7271 - name : Install dependencies
7372 if : steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
74- run : poetry install --no-interaction --no-root
75-
73+ run : poetry install --no-interaction --no-root --all-extras
74+
75+ # ----------------------------------------------
76+ # install your root project, if required
7677 # ----------------------------------------------
77- # install your root project, if required
78- # ----------------------------------------------
7978 - name : Install library
8079 run : poetry install --no-interaction
81-
80+
8281 # ----------------------------------------------
8382 # perform linting
84- # ----------------------------------------------
83+ # ----------------------------------------------
8584 # Disabled until we agree to turn it on
8685 # - name: Lint with flake8
8786 # run: |
@@ -93,14 +92,34 @@ jobs:
9392 # ----------------------------------------------
9493 # check formatting
9594 # ----------------------------------------------
96- # Disabled until we agree to turn it on
97- # - name: Code formatting with black
98- # run: |
99- # # run black in check mode
100- # # if files are not formatted correctly, the build will not go through
101- # black . --check
95+ - name : Code formatting with black
96+ run : |
97+ # ran only on certain files for now
98+ # add here when checked
99+ poetry run black schematic/configuration.py schematic/exceptions.py schematic/help.py schematic/loader.py schematic/version.py --check
100+
102101 # ----------------------------------------------
103- # run test suite
102+ # type checking/enforcement
103+ # ----------------------------------------------
104+ - name : Type checking with mypy
105+ run : |
106+ # ran only on certain files for now
107+ # add here when checked
108+ poetry run mypy --install-types --non-interactive schematic/configuration.py
109+ # add here when enforced
110+ poetry run mypy --disallow-untyped-defs --install-types --non-interactive schematic/exceptions.py schematic/help.py schematic/loader.py schematic/version.py
111+
112+ # ----------------------------------------------
113+ # linting
114+ # ----------------------------------------------
115+ - name : Lint with pylint
116+ run : |
117+ # ran only on certain files for now
118+ # add here when checked
119+ poetry run pylint schematic/exceptions.py schematic/help.py schematic/loader.py schematic/version.py
120+
121+ # ----------------------------------------------
122+ # run test suite
104123 # ----------------------------------------------
105124 - name : Run regular tests and rule combination tests
106125 env :
@@ -109,8 +128,8 @@ jobs:
109128 run : >
110129 source .venv/bin/activate;
111130 pytest --cov-report=term --cov-report=html:htmlcov --cov=schematic/
112- -m "not (google_credentials_needed or table_operations)"
113-
131+ -m "not (google_credentials_needed or schematic_api or table_operations)"
132+
114133 - name : Run tests
115134 env :
116135 SYNAPSE_ACCESS_TOKEN : ${{ secrets.SYNAPSE_ACCESS_TOKEN }}
@@ -120,7 +139,7 @@ jobs:
120139 source .venv/bin/activate;
121140 pytest --cov-report=term --cov-report=html:htmlcov --cov=schematic/
122141 -m "not (google_credentials_needed or rule_combos or schematic_api or table_operations)"
123-
142+
124143 - name : Upload pytest test results
125144 uses : actions/upload-artifact@v2
126145 with :
0 commit comments