diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..5f8ecd2d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: weekly + reviewers: + - SMI/reviewers diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 00000000..4278f3a4 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -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}}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..9bf69903 --- /dev/null +++ b/.github/workflows/main.yml @@ -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 \ No newline at end of file diff --git a/src/lib/SmiServices/DicomText.py b/src/lib/SmiServices/DicomText.py index eb67707b..7b369cff 100644 --- a/src/lib/SmiServices/DicomText.py +++ b/src/lib/SmiServices/DicomText.py @@ -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