Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 0 additions & 114 deletions .circleci/config.yml

This file was deleted.

23 changes: 23 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .coveragerc
[report]
omit =
*/__init__.py
ckanext/recombinant/tests/
ckanext/recombinant/migration/
ckanext/recombinant/i18n/
ckanext/recombinant/assets/
ckanext/recombinant/public/
ckanext/recombinant/strings.py
ckanext/recombinant/extract.py
bin/
build/
conf/
links/
node_modules/
docs/
samples/
ckanext_recombinant.egg-info/
changes/
.github/
.pytest_cache/
setup.py
11 changes: 0 additions & 11 deletions .github/workflows/circleci.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Lint
on: [pull_request]
on: [workflow_call, workflow_dispatch]

permissions:
contents: read
Expand Down
105 changes: 77 additions & 28 deletions .github/workflows/pyright.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,95 @@
name: Check types
on: [pull_request]
on: [workflow_call, workflow_dispatch]
env:
NODE_VERSION: '18'
PYTHON_VERSION: '3.9'

permissions:
contents: read

jobs:
typecheck:
runs-on: ubuntu-latest
container:
image: opendatacanada/ckan-pytest # primary executor
steps:
- uses: actions/checkout@v2
id: gitcheckout
- uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/setup-node@v3
- name: Install Node
run: |
apk add nodejs npm
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install python deps
id: pydepends
if: steps.gitcheckout.outcome == 'success'
- name: Check Source Dependency Versions
run: |
python3 -m venv /home/runner/work/app
mkdir -p /home/runner/work/app/src/ckanext-recombinant
cp -R . /home/runner/work/app/src/ckanext-recombinant
source /home/runner/work/app/bin/activate
pip install --upgrade setuptools==70.0.0
pip install --upgrade pip==23.2.1
pip install -e 'git+https://github.com/open-data/ckan@canada-v2.10#egg=ckan' -r 'https://raw.githubusercontent.com/open-data/ckan/canada-v2.10/requirement-setuptools.txt' -r 'https://raw.githubusercontent.com/open-data/ckan/canada-v2.10/requirements.txt' -r 'https://raw.githubusercontent.com/open-data/ckan/canada-v2.10/dev-requirements.txt'
pip install -e 'git+https://github.com/ckan/ckanapi.git#egg=ckanapi' -r 'https://raw.githubusercontent.com/ckan/ckanapi/master/requirements.txt'
pip install -e /home/runner/work/app/src/ckanext-recombinant/. -r /home/runner/work/app/src/ckanext-recombinant/requirements.txt -r /home/runner/work/app/src/ckanext-recombinant/test-requirements.txt
pip install -e 'git+https://github.com/ckan/ckantoolkit.git#egg=ckantoolkit' -r 'https://raw.githubusercontent.com/ckan/ckantoolkit/master/requirements.txt'
find /home/runner/work/app -name '*.pyc' -delete
- name: Install node deps
if: steps.pydepends.outcome == 'success'
source /srv/app/venv/bin/activate
for dir in /srv/app/src/*; do
srcName=$(echo "$dir" | awk -F'/' '{print $NF}');
if [[ -d "$dir/.git" ]]; then
printf "\n${srcName}: Checking for updates..."
cd $dir;
current_branch=$(git rev-parse --abbrev-ref HEAD);
if [[ "$srcName" == "ckan" ]]; then
git fetch canada;
reslog=$(git log HEAD..canada/$current_branch --oneline);
else
git fetch origin;
reslog=$(git log HEAD..origin/$current_branch --oneline);
fi;
if [[ "${reslog}" == "" ]]; then
printf "\n${srcName}: Up to date. Skipping..."
else
git pull || true;
printf "\n${srcName}: Pulled updated code. Re-initializing in python environment..."
cd /srv/app;
if [[ -f "$dir/requirements.txt" ]]; then
pip install -r $dir/requirements.txt || true;
fi;
if [[ -f "$dir/dev-requirements.txt" ]]; then
pip install -r $dir/dev-requirements.txt || true;
fi;
if [[ -f "$dir/test-requirements.txt" ]]; then
pip install -r $dir/test-requirements.txt || true;
fi;
if [[ -f "$dir/setup.py" ]]; then
python $dir/setup.py develop || true;
fi;
fi;
else
printf "\n${srcName}: Not a source repository. Skipping..."
fi;
done;
cd /srv/app;
- name: Checkout Repository (${{ github.head_ref || github.ref_name }})
id: gitcheckout
run: |
cd /srv/app/src/ckanext-recombinant
git fetch origin
if [[ "${{ github.head_ref || github.ref_name }}" != "master" ]]; then
git checkout -b ${{ github.head_ref || github.ref_name }} origin/${{ github.head_ref || github.ref_name }}
fi;
git fetch
git pull
source /srv/app/venv/bin/activate
pip install -e .
pip install -r requirements.txt
pip install -r test-requirements.txt
python3 setup.py develop
cd /srv/app
- name: Install Node Dependencies
if: steps.gitcheckout.outcome == 'success'
run: |
cd /home/runner/work/app/src/ckanext-recombinant
source /srv/app/venv/bin/activate
cd /srv/app/src/ckanext-recombinant
printf "\nNode Version: $(node --version)"
printf "\nNPM Version: $(npm --version)"
printf "\nPython Version: $(python3 --version)\n"
npm ci
- name: Check types
if: steps.pydepends.outcome == 'success'
- name: Check Types
if: steps.gitcheckout.outcome == 'success'
run: |
cd /home/runner/work/app/src/ckanext-recombinant
export PYTHONPATH="${PYTHONPATH}:/srv/app/lib/python3.9/site-packages:/srv/app/src/ckanext-citeproc"
source /srv/app/venv/bin/activate
cd /srv/app/src/ckanext-recombinant
printf "\nNode Version: $(node --version)"
printf "\nNPM Version: $(npm --version)"
printf "\nPython Version: $(python3 --version)\n"
npx pyright
Loading
Loading