Check pip dependencies #386
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Check pip dependencies" | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- api/Pipfile | |
push: | |
branches: | |
- main | |
paths: | |
- api/Pipfile | |
schedule: | |
- cron: '0 19 * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
env: | |
DEFAULT_PYTHON: "3.10" | |
API_DIRS: ./api | |
jobs: | |
check-dependencies: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ${{ env.API_DIRS }} | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- name: Check out code from GitHub | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ env.DEFAULT_PYTHON }} | |
id: python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ env.DEFAULT_PYTHON }} | |
- name: Setup pipenv | |
run: | | |
pip install --user pipenv | |
# This job will exit when dependencies error occurs | |
- name: Run pipenv lock. | |
run: | | |
pipenv lock --dev | |
- name: Upload Pipfile.lock as an artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
path: ${{ env.API_DIRS }}/Pipfile.lock |