Skip to content
Open
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
40 changes: 19 additions & 21 deletions Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# TODO-STEP 1: Define the Workflow Name
# Uncomment the following line and replace <WORKFLOW_NAME> with a descriptive name. For example: Python CI/CD Pipeline
#name: <WORKFLOW NAME>
name: Python CI/CD Pipeline

# TODO-STEP 2: Define the Trigger Events
# Uncomment the following lines to trigger the workflow on push and pull request events
#on:
# push:
# pull_request:
on:
push:
pull_request:

jobs:
# Build job
# TODO-STEP 3: Create your "Build" job
#<ENTER JOB NAME 1>:
explore-github-actions:
# TODO-STEP 3a: Specify the runner for this job
#runs-on: ubuntu-latest
runs-on: ubuntu-latest

steps:
- name: Checkout repository
Expand All @@ -25,20 +25,20 @@ jobs:
python-version: '3.9'

# TODO-STEP 3b: Enter a name for your step to display on GitHub. For example: Install dependencies
#- name: <NAME OF STEP>
- name: Install dependencies
# TODO-STEP 3c: Add commands to install dependencies
# Hint: Use pip to install packages from requirements.txt
# run: |
# python -m pip install --upgrade pip
# pip install -r <FILE NAME>.txt
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

# Test job
# TODO-STEP 4: Create your "Test" job
#<ENTER JOB NAME 2>:
test-job:
# TODO-STEP 4a: Ensure this job runs after the build job.
# NOTE: Make sure to use the Job Name used above in Line 14.
#needs: <ENTER JOB NAME 1>
#runs-on: ubuntu-latest
needs: explore-github-actions
runs-on: ubuntu-latest

steps:
- name: Checkout repository
Expand All @@ -50,14 +50,12 @@ jobs:
python-version: '3.9'

# TODO-STEP 4b: Add command to install dependencies
#- name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

# TODO-STEP 4c: Add command to run tests
# Hint: Use pytest to run your test cases
#- name: Run tests
# run: pytest

# Remember to remove the '#' to uncomment lines when filling in the placeholders
- name: Run tests
run: pytest