Skip to content

Commit

Permalink
add initial CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rkm committed Feb 15, 2024
1 parent 5cf2c54 commit 70e6de8
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: weekly
reviewers:
- SMI/reviewers
37 changes: 37 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: "CodeQL"

on:
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
schedule:
- cron: "0 5 * * *"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: ["python"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: main

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 6 * * *"

defaults:
run:
shell: bash

env:
python-version: 3.10

jobs:
test-lib:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python-version }}
- name: test and package python
run: |
set -exuo pipefail
python -m venv venv
. venv/bin/activate
pushd src/lib
python -m pip install -r requirements.txt -r requirements-dev.txt
python -m pytest SmiServices/*.py
2 changes: 1 addition & 1 deletion src/lib/SmiServices/DicomText.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def test_DicomText():
""" The test function requires a specially-crafted DICOM file
as provided with SRAnonTool that has been modified to include HTML.
"""
dcm = os.path.join(os.path.dirname(__file__), '../../../applications/SRAnonTool/test/report10html.dcm')
dcm = os.path.join(os.path.dirname(__file__), '../../../src/applications/SRAnonTool/test/report10html.dcm')
expected_without_header = """[[ContentSequence]]
# Request
MRI: Knee
Expand Down

0 comments on commit 70e6de8

Please sign in to comment.