DEV Community

zoharasulin
zoharasulin

Posted on

OSDC-Assigment9-GithubActions(CI)

In lesson 9 we learned about "Continuous Integration(CI) for GitHub projects" We learned GitHub Actions and provided examples of how to use them. The presentation included a demonstration of a simple workflow and implementation, examples of how to trigger jobs, and an overview of environment variables and repositories from @szabgab.
This links can help learn the subject:

The assignment was to find a project with tests but without continuous integration and set up a GitHub Action to run the tests.
I find intresting project universities-api-wrapper from pydigger
This steps of my work in here assigment:
1) Fork the project to be able edit it.

2) Add GitHub Actions Workflow to ci.yml. in folders i create .github/workflow.

3) Create ci.yml - this my code:

name: CI

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.9  

      - name: Install dependencies
        run: pip install -r requirements.txt

      - name: Run tests
        run: pytest
Enter fullscreen mode Exit fullscreen mode

4) Validate my code yaml in yaml-validator

5) send PR that i explain to author why i create the file ci.yml.

6) To activate the workflow, you need to select it from the Actions menu and run it manually.

Update: my PR is merged:Hi @zoharasulin. Thank you! I was intending to create this at some point, so it was very helpful you to create this pull request. Much appreciated.

that's it!!
Thank you for listening,
Zohar.

Top comments (0)