GitHub Actions is a continuous integration and continuous deployment (CI/CD) platform that enables developers to automate their workflows across issues, pull requests, and more. GitHub Actions was introduced in 2018 to assist developers in automating their workflows within GitHub.
All GitHub Actions automation is handled via workflows, which are YAML files placed under the .github/workflows directory in a repository that defines automated processes.
There are different core concepts for every workflow. They are:
- Events: A workflow is triggered by specific triggers called events.
- Jobs: Jobs are a set of steps executed on the same runner. Unless otherwise stated, each run in a separate VM while running concurrently with other jobs.
- Steps: Steps are the individual tasks that run commands in a job. Only one runner is used to execute all steps that are present in a job.
- Actions: It is a command that is executed on a runner, and it is the core element of GitHub Actions.
- Runners: It is a GitHub Actions server that runs the workflows when they're triggered. At a time, the runner runs only a single job.
What are Linters?
Linters are programs that inspect the quality of the code by displaying errors and warnings. The advantages of using Python linters are:
- Project bug prevention
- Making Python code understandable to all programmers
- Identifying unnecessary code fragments.
- Simplifying and cleaning up the code
- Check for syntax errors, etc.
Pylint, Flake8, and PyFlakes are some examples of linters.
Pylint is a static Python code analysis tool that identifies programming errors, invalid code constructs, and coding standards violations. Furthermore, Pylint can be adjusted to our needs by disabling some of the reported bugs; for example, output messages can only include information about specific kinds of errors. Pylint message consists of five errors: R, C, W, E, and F.
Below are the sample workflows which run when the developer raises the pull request:
Advantages of Pylint:
- It triggers more false positives present in the code.
- It can be customized for specific kinds of errors
- It gives the rating for the code quality