diff --git a/.github/workflows/github-ci.yml b/.github/workflows/github-ci.yml new file mode 100644 index 0000000..ed6aa18 --- /dev/null +++ b/.github/workflows/github-ci.yml @@ -0,0 +1,44 @@ +name: Python CI/CD Pipeline_1 + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r "Week 1/GitHub Actions Practice/requirements.txt" + + test: + needs: build + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.9' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r "Week 1/GitHub Actions Practice/requirements.txt" + + - name: Run tests + run: pytest \ No newline at end of file diff --git a/Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml b/Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml deleted file mode 100644 index 31e8ee0..0000000 --- a/Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml +++ /dev/null @@ -1,63 +0,0 @@ -# TODO-STEP 1: Define the Workflow Name -# Uncomment the following line and replace with a descriptive name. For example: Python CI/CD Pipeline -#name: - -# 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: - -jobs: - # Build job - # TODO-STEP 3: Create your "Build" job - #: - # TODO-STEP 3a: Specify the runner for this job - #runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.9' - - # TODO-STEP 3b: Enter a name for your step to display on GitHub. For example: Install dependencies - #- name: - # 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 .txt - - # Test job - # TODO-STEP 4: Create your "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: - #runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - 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 - - # 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 \ No newline at end of file