From fc55f8caca8e184e3ea028bd289ea82027e1caed Mon Sep 17 00:00:00 2001 From: Vicky Bikia Date: Wed, 12 Feb 2025 12:34:02 -0800 Subject: [PATCH 1/2] Add workflows .yml files for markdown link check and pylinting --- .github/workflows/build-and-test.yml | 45 ++++++++++++++++++++++++++++ .github/workflows/pull_request.yml | 37 +++++++++++++++++++++++ .reuse/dep5.txt | 6 ++++ 3 files changed, 88 insertions(+) create mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/pull_request.yml create mode 100644 .reuse/dep5.txt diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..23d3d99 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,45 @@ +# +# This source file is part of the Daneshjou Lab projects +# +# SPDX-FileCopyrightText: 2025 Stanford University and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: Build and Test + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + workflow_call: + +jobs: + pylint: + name: PyLint + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10"] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install Infrastructure + run: | + pip install -r requirements.txt + pip install pylint + - name: Analysing the code with pylint + run: | + pylint $(git ls-files '*.py') + black_lint: + name: Black Code Formatter Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + - name: Install Black + run: pip install black[jupyter] + - name: Check code formatting with Black + run: black . --exclude '\.ipynb$' diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..9026caa --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,37 @@ +# +# This source file is part of the Daneshjou Lab projects +# +# SPDX-FileCopyrightText: 2025 Stanford University and the project authors (see CONTRIBUTORS.md) +# +# SPDX-License-Identifier: MIT +# + +name: Pull Request + +on: + pull_request: + workflow_dispatch: + +jobs: + reuse_action: + name: REUSE Compliance Check + uses: PathReportParsing_MRA_DeepDerm/.github/.github/workflows/reuse.yml@v2 + markdown_link_check: + name: Markdown Link Check + uses: DaneshjouLab/.github/.github/workflows/markdown-link-check.yml@v2 + yamllint: + name: YAML Lint Check + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + + - name: Install yamllint + run: pip install yamllint + + - name: Run yamllint with custom config + run: yamllint -c .yamllint .github/workflows/*.yml diff --git a/.reuse/dep5.txt b/.reuse/dep5.txt new file mode 100644 index 0000000..9d6c7d7 --- /dev/null +++ b/.reuse/dep5.txt @@ -0,0 +1,6 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ + +Files: tests/* +Copyright: 2025 Stanford University and the project authors (see CONTRIBUTORS.md) +License: MIT +Comment: All files are part of the Daneshjou Lab projects. From ab534329c1e2cb5f6b1c0fe713ca1cdf1d412e3b Mon Sep 17 00:00:00 2001 From: Vicky Bikia Date: Thu, 13 Feb 2025 19:24:47 -0800 Subject: [PATCH 2/2] Integrate REUSE Compliance check workflow --- .github/workflows/pull_request.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 9026caa..c74fa09 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -15,10 +15,10 @@ on: jobs: reuse_action: name: REUSE Compliance Check - uses: PathReportParsing_MRA_DeepDerm/.github/.github/workflows/reuse.yml@v2 + uses: DaneshjouLab/.github/.github/workflows/reuse.yml@main markdown_link_check: name: Markdown Link Check - uses: DaneshjouLab/.github/.github/workflows/markdown-link-check.yml@v2 + uses: DaneshjouLab/.github/.github/workflows/markdown-link-check.yml@main yamllint: name: YAML Lint Check runs-on: ubuntu-latest