Giter Club home page Giter Club logo

github-cicd-course's Introduction

GitHub CI/CD practice

Sources for practice lecture about containers used in NSWI026 MFF UK and SEPA4M33SEP, FEL CVUT. This should be a simple example for CI/CD, it's not recommended for a production usage.

Tasks

  1. Take a look on basic usage of GitHub workflows.

  2. Take a look on script in task_a.

    • (Optional) Prepare an env python3 -m venv venv, activate it source venv/bin/activate and install dependencies pip3 install -r requirements.txt.
    • (Optional) Try to execute tests pytest task_a.py.

On push events

  1. Make one test failing and fill a GitHub workflow to execute tests.
    • Change .github/workflows/task-a-cd.yml and push it to your GitHub.
  2. Try to speed up testing using cache on one of following methods.
  3. Generate an html report with --html=report.html and upload it to GitHub using actions/upload-artifact
  4. Run tests on multiple operating systems and Python versions using matrix option.
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
        python-version: ["3.10", "3.11", "pypy3.10"]
        exclude:
          - os: macos-latest
            python-version: "3.10"
          - os: windows-latest
            python-version: "3.10"

On pull request

  1. Change "task-a-cd.yml" to task-a-ci.yml and change to be executed on a pull-request, take a look on pull_request.
  2. Run this pull request only on changes tu folder task_a, take a look on paths.

On manual event

  1. Try a manual workflow "task-b manual".
  2. Build a docker image, using docker/build-push-action, you could reuse following lines
  • Create an workflow input tag for image tag
  • Tag image like ghcr.io/${{ github.repository }}:${{ inputs.tag }}
  1. Build a dependent job test
  • It should depend on docker job
  • It should run docker container from previous step as service container
  • Call curl 127.0.0.1:8080/index.html to fetch index.html

Build our flight-log

  1. Get own repository for FlightLog

github-cicd-course's People

Contributors

maresmar avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.