From 35aff8031b77e7185d96911a3e214b0e25422124 Mon Sep 17 00:00:00 2001 From: Le Cong Phuc Date: Wed, 25 Mar 2026 10:33:51 +0700 Subject: [PATCH 1/5] practice ci/cd --- .../.github/workflows/github-ci.yml | 93 ++++++++----------- 1 file changed, 37 insertions(+), 56 deletions(-) diff --git a/Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml b/Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml index 31e8ee0..e4add87 100644 --- a/Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml +++ b/Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml @@ -1,63 +1,44 @@ -# TODO-STEP 1: Define the Workflow Name -# Uncomment the following line and replace with a descriptive name. For example: Python CI/CD Pipeline -#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 - #: - # TODO-STEP 3a: Specify the runner for this job - #runs-on: ubuntu-latest + 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' - - # 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 + - 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 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' - - # 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 + - 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 requirements.txt + + - name: Run tests + run: pytest \ No newline at end of file From 12f25609db4a53ec564908e4b83f8c17d802efd1 Mon Sep 17 00:00:00 2001 From: Le Cong Phuc Date: Wed, 25 Mar 2026 10:44:17 +0700 Subject: [PATCH 2/5] test --- Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml b/Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml index e4add87..2b4f7f0 100644 --- a/Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml +++ b/Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml @@ -1,4 +1,4 @@ -name: Python CI/CD Pipeline +name: Python CI/CD Pipeline_1 on: push: From c03a66104788af5eb46f8568ec0bd26fcf6befe0 Mon Sep 17 00:00:00 2001 From: Le Cong Phuc Date: Wed, 25 Mar 2026 10:51:43 +0700 Subject: [PATCH 3/5] fix: move github actions workflow to correct directory --- .../.github => .github}/workflows/github-ci.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {Week 1/GitHub Actions Practice/.github => .github}/workflows/github-ci.yml (100%) diff --git a/Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml b/.github/workflows/github-ci.yml similarity index 100% rename from Week 1/GitHub Actions Practice/.github/workflows/github-ci.yml rename to .github/workflows/github-ci.yml From 3dc7a97942c600074f5dad9aa0a8ea35cedd0c7e Mon Sep 17 00:00:00 2001 From: Le Cong Phuc Date: Wed, 25 Mar 2026 10:56:01 +0700 Subject: [PATCH 4/5] fix bug --- .github/workflows/github-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github-ci.yml b/.github/workflows/github-ci.yml index 2b4f7f0..b9b3e1a 100644 --- a/.github/workflows/github-ci.yml +++ b/.github/workflows/github-ci.yml @@ -10,17 +10,17 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.9' - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt + pip install -r "Week 1/GitHub Actions Practice/requirements.txt" test: needs: build From c86a8bdd70090b41c9d432ae59a0c98719201307 Mon Sep 17 00:00:00 2001 From: Le Cong Phuc Date: Wed, 25 Mar 2026 10:57:29 +0700 Subject: [PATCH 5/5] fix bug install .txt --- .github/workflows/github-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-ci.yml b/.github/workflows/github-ci.yml index b9b3e1a..ed6aa18 100644 --- a/.github/workflows/github-ci.yml +++ b/.github/workflows/github-ci.yml @@ -38,7 +38,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt + pip install -r "Week 1/GitHub Actions Practice/requirements.txt" - name: Run tests run: pytest \ No newline at end of file