Skip to content

Commit

Permalink
Add capabilities to support multiple requirements files
Browse files Browse the repository at this point in the history
  • Loading branch information
TGWolf committed Jun 24, 2024
1 parent 4faad3c commit 6230ef1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 42 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,6 @@ concurrency:
permissions: read-all

jobs:
get-python-versions:
name: Get Python Versions (>= 3.9)
runs-on: ubuntu-latest
outputs:
version-matrix: ${{ steps.get-language-versions.outputs.latest-versions }}

steps:
- name: Get Required Versions
uses: ActionsToolbox/get-language-versions-action@446919617fd774095b5dd3ed71c39dd3fd0d8f4f # v0.1.3
id: get-language-versions
with:
language: "python"
min-version: 3.9
remove-patch-version: true

shellcheck:
name: ShellCheck
runs-on: ubuntu-latest
Expand All @@ -48,34 +33,11 @@ jobs:
- name: Perform ShellCheck Analysis
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/shellcheck/master/pipeline.sh)

pur:
name: Pur
needs: get-python-versions
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-versions: ${{ fromJson(needs.get-python-versions.outputs.version-matrix) }}

steps:
- name: Checkout the Repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Python ${{ matrix.python-versions }}
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python-versions }}

- name: Perform Pur Analysis
run: bash <(curl -s https://raw.githubusercontent.com/CICDToolbox/pur/master/pipeline.sh)

cicd-pipeline:
if: always()
name: CI/CD Pipeline
needs:
- shellcheck
- pur
runs-on: ubuntu-latest

steps:
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ message: If you use this software, please cite it using these metadata.
title: Pur
abstract: A tool to notify you of out of date requirements in requirements.txt.
type: software
version: 0.1.0
date-released: 2024-05-22
version: 0.1.1
date-released: 2024-06-24
repository-code: https://github.com/CICDToolbox/pur
keywords:
- "Wolf Software"
Expand Down
4 changes: 2 additions & 2 deletions pipeline.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ BANNER_NAME="${TEST_COMMAND[*]}"
FILE_TYPE_SEARCH_PATTERN='No Magic String'

# File name to match [Regex based]
FILE_NAME_SEARCH_PATTERN='\requirements.txt$'
FILE_NAME_SEARCH_PATTERN='\requirements*.txt$'

# Set where to look for files.
SCAN_ROOT='.'
Expand Down Expand Up @@ -270,7 +270,7 @@ function install_prerequisites()
fail "${CMD[*]}" "${errors}" true
exit "${EXIT_VALUE}"
fi
done < <(find . -name 'requirements.txt' -type f -not -path "./.git/*" | sed 's|^./||' | sort -Vf || true)
done < <(find . -name 'requirements*.txt' -type f -not -path "./.git/*" | sed 's|^./||' | sort -Vf || true)
fi
}

Expand Down

0 comments on commit 6230ef1

Please sign in to comment.