Skip to content
Open
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
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ exclude = .github,
.pytest_cache,
cdisc_rules_engine/resources,
venv,
.venv,
build,
dist
4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/1-bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ body:
value: https://jira.cdisc.org/projects/CORERULES/issues/CORERULES-
- type: markdown
attributes:
value: "\nIn the next fields, please provide a [Minimal Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example)."
value: |
In the next fields, please provide a
[Minimal Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example).
- type: input
id: cli_command
validations:
Expand Down
39 changes: 36 additions & 3 deletions .github/workflows/build-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,46 @@ jobs:

- name: Build Binary (Linux)
if: runner.os == 'Linux'
run: pyinstaller --onedir --contents-directory "." core.py --icon=resources/assets/CORE_logo_sm.ico --dist ./dist/output/${{ inputs.name }} --collect-submodules pyreadstat --add-data=$pythonLocation/lib/python3.12/site-packages/xmlschema/schemas:xmlschema/schemas --add-data=resources/cache:resources/cache --add-data=resources/templates:resources/templates --add-data=resources/schema:resources/schema --add-data=resources/datasets:resources/datasets --add-data=resources/jsonata:resources/jsonata
run: >-
pyinstaller --onedir --contents-directory "." core.py
--icon=resources/assets/CORE_logo_sm.ico
--dist ./dist/output/${{ inputs.name }}
--collect-submodules pyreadstat
--add-data=$pythonLocation/lib/python3.12/site-packages/xmlschema/schemas:xmlschema/schemas
--add-data=resources/cache:resources/cache
--add-data=resources/templates:resources/templates
--add-data=resources/schema:resources/schema
--add-data=resources/datasets:resources/datasets
--add-data=resources/jsonata:resources/jsonata
- name: Build Binary (Mac)
if: runner.os == 'macOS'
run: pyinstaller --onedir --contents-directory "." core.py --icon=resources/assets/CORE_logo_sm.icns --dist ./dist/output/${{ inputs.name }} --collect-submodules pyreadstat --add-data=$pythonLocation/lib/python3.12/site-packages/xmlschema/schemas:xmlschema/schemas --add-data=resources/cache:resources/cache --add-data=resources/templates:resources/templates --add-data=resources/schema:resources/schema --add-data=resources/datasets:resources/datasets --add-data=resources/jsonata:resources/jsonata
run: >-
pyinstaller --onedir --contents-directory "." core.py
--icon=resources/assets/CORE_logo_sm.icns
--dist ./dist/output/${{ inputs.name }}
--collect-submodules pyreadstat
--add-data=$pythonLocation/lib/python3.12/site-packages/xmlschema/schemas:xmlschema/schemas
--add-data=resources/cache:resources/cache
--add-data=resources/templates:resources/templates
--add-data=resources/schema:resources/schema
--add-data=resources/datasets:resources/datasets
--add-data=resources/jsonata:resources/jsonata
- name: Build Binary (Windows)
if: runner.os == 'Windows'
run: pyinstaller --onedir --contents-directory "." core.py --icon=resources/assets/CORE_logo_sm.ico --dist ./dist/output/${{ inputs.name }} --collect-submodules pyreadstat --add-data="$env:pythonLocation\Lib\site-packages\xmlschema\schemas;xmlschema/schemas" --hidden-import numpy --hidden-import numpy.core._methods --hidden-import numpy.lib.format --add-data="resources/cache;resources/cache" --add-data="resources/templates;resources/templates" --add-data="resources/schema;resources/schema" --add-data="resources/datasets;resources/datasets" --add-data="resources/jsonata;resources/jsonata"
run: >-
pyinstaller --onedir --contents-directory "." core.py
--icon=resources/assets/CORE_logo_sm.ico
--dist ./dist/output/${{ inputs.name }}
--collect-submodules pyreadstat
--add-data="$env:pythonLocation\Lib\site-packages\xmlschema\schemas;xmlschema/schemas"
--hidden-import numpy
--hidden-import numpy.core._methods
--hidden-import numpy.lib.format
--add-data="resources/cache;resources/cache"
--add-data="resources/templates;resources/templates"
--add-data="resources/schema;resources/schema"
--add-data="resources/datasets;resources/datasets"
--add-data="resources/jsonata;resources/jsonata"
- name: Archive Binary
uses: actions/upload-artifact@v6
with:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/check-schema-markdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ jobs:
run: |
npm i prettier
npx prettier resources/schema/rule-merged/*.json --write
- uses: CatChen/check-git-status-action@7b45cb4ce3e00a8bce4910dc2d5f2785235a6d7e # v2.1.2
- uses: CatChen/check-git-status-action@7b45cb4ce3e00a8bce4910dc2d5f2785235a6d7e # v2.1.2
with:
fail-if-not-clean: true
request-changes-if-not-clean: ${{ github.event_name == 'pull_request' }}
request-changes-comment: Updated schema has not been merged with markdown descriptions. Please run the "Merge Schema with Markdown Descriptions" workflow to update the merged schema files.
request-changes-comment: >-
Updated schema has not been merged with markdown descriptions.
Please run the "Merge Schema with Markdown Descriptions" workflow
to update the merged schema files.
targets: resources/schema/rule-merged
9 changes: 7 additions & 2 deletions .github/workflows/deploy-rule-tester.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ permissions:
contents: read

env:
creds: '{"clientId":"${{ vars.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ vars.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ vars.AZURE_TENANT_ID }}"}'
creds: >-
{"clientId":"${{ vars.AZURE_CLIENT_ID }}",
"clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}",
"subscriptionId":"${{ vars.AZURE_SUBSCRIPTION_ID }}",
"tenantId":"${{ vars.AZURE_TENANT_ID }}"}
functionAppName: cdisc-library-conformance-rules-generator-dev
PYTHON_VERSION: "3.12"

Expand All @@ -34,7 +38,8 @@ jobs:
with:
app-name: ${{ env.functionAppName }}
mask-inputs: false
app-settings-json: '{"WEBSITE_ENABLE_SYNC_UPDATE_SITE": "1"}' # wait for this step to complete before the webapps-deploy step
# wait for this step to complete before the webapps-deploy step
app-settings-json: '{"WEBSITE_ENABLE_SYNC_UPDATE_SITE": "1"}'
general-settings-json: '{"linuxFxVersion": "PYTHON|${{ env.PYTHON_VERSION }}"}'
slot-name: ${{ vars.AZURE_WEBAPP_SLOT }}

Expand Down
61 changes: 47 additions & 14 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,34 @@ on:
- main
permissions:
contents: read

jobs:
get_changed_files:
runs-on: ubuntu-latest
outputs:
py: ${{ steps.changes.outputs.py_all_changed_files }}
pretty: ${{ steps.changes.outputs.pretty_all_changed_files }}
yaml: ${{ steps.changes.outputs.yaml_all_changed_files }}
md: ${{ steps.changes.outputs.md_all_changed_files }}
json: ${{ steps.changes.outputs.json_all_changed_files }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Get changed files
id: changes
uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4
uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4
with:
files_yaml: |
py:
- '**.py'
pretty:
- '**.json'
- '**.md'
yaml:
- '**.yaml'
- '**.yml'
md:
- '**.md'
json:
- '**.json'
separator: " "

check_python_files:
runs-on: ubuntu-latest
needs: get_changed_files
Expand All @@ -57,19 +59,50 @@ jobs:
- name: Run black
run: |
black --check ${{needs.get_changed_files.outputs.py}}

check_prettier_files:
check_json_files:
runs-on: ubuntu-latest
needs: get_changed_files
# only run if there are changed files
if: ${{needs.get_changed_files.outputs.pretty}}
if: ${{needs.get_changed_files.outputs.json}}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Run json lint
run: |
for f in ${{needs.get_changed_files.outputs.json}}; do
python -m json.tool $f > /dev/null && echo "$f OK" || exit 1
done
check_yaml_files:
runs-on: ubuntu-latest
needs: get_changed_files
if: ${{needs.get_changed_files.outputs.yaml}}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install yamllint
run: |
pip install yamllint -c requirements-dev.txt
- name: Run yamllint
run: |
yamllint ${{needs.get_changed_files.outputs.yaml}}
check_markdown_files:
runs-on: ubuntu-latest
needs: get_changed_files
if: ${{needs.get_changed_files.outputs.md}}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-node@v6
- name: Run prettier
- name: Run markdownlint
run: |
npm i prettier
npx prettier --check ${{needs.get_changed_files.outputs.pretty}}
npm i markdownlint-cli2
npx markdownlint-cli2 ${{needs.get_changed_files.outputs.md}}
3 changes: 2 additions & 1 deletion .github/workflows/prerelease-update-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ jobs:
with:
# https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key
# git bash: ssh-keygen -t ed25519 -C "github-actions@cdisc.org"
# Add public key (.pub one) as a deploy key at Your repo -> Settings -> Security -> Deploy keys, check "Allow write access".
# Add public key (.pub one) as a deploy key at
# Your repo -> Settings -> Security -> Deploy keys, check "Allow write access".
# Add private key as a secret at Your repo -> Settings -> Security -> Secrets and variables -> Actions
ssh-key: ${{ secrets.GH_ACTION_PRIVATE_KEY }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/prerelease-update-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
uses: actions/checkout@v6
with:
# https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent#generating-a-new-ssh-key
# git bash: ssh-keygen -t ed25519 -C "github-actions@cdisc.org"
# Add public key (.pub one) as a deploy key at Your repo -> Settings -> Security -> Deploy keys, check "Allow write access".
# Add private key as a secret at Your repo -> Settings -> Security -> Secrets and variables -> Actions
# Generate SSH key: ssh-keygen -t ed25519 -C "github-actions@cdisc.org"
# Add public key as deploy key (Settings -> Security -> Deploy keys, allow write access)
# Add private key as secret (Settings -> Security -> Secrets and variables -> Actions)
ssh-key: ${{ secrets.GH_ACTION_PRIVATE_KEY }}

- name: Set up Python
Expand Down
Loading
Loading