Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add initial CI #4

Merged
merged 1 commit into from
Feb 15, 2024
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
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