Urgent.News

What's breaking now, across thousands of outlets.

Tech

How to Add Quality Gates to a GitHub Actions Pipeline (Step by Step)

Most CI pipelines run tests. Far fewer pipelines actually stop bad code from reaching production. The difference is a quality gate : a check that must pass before the pipeline is allowed to move to the next stage. In this tutorial, you'll build a GitHub Actions pipeline with four gates: Lint: code style and obvious errors Unit tests + coverage threshold: fail if coverage drops below a minimum API…

Quality gates enhance CI pipelines by ensuring that only code meeting specific standards progresses through the development process. This tutorial demonstrates how to build a GitHub Actions pipeline with four quality gates: linting, unit tests with a coverage threshold, API tests, and manual approval. The gates are structured in order of increasing cost and complexity, allowing for early detection of issues while minimizing delays.

To set up the pipeline, create a workflow file named `.github/workflows/pipeline.yml`. The first job, named "lint," runs on an Ubuntu environment and checks for code style issues and syntax errors using the Ruff linter. Subsequent jobs include unit tests with a 80% coverage threshold, API tests against the running service, and a manual approval step before deployment to the production environment.

It's crucial to measure the current coverage of the codebase and begin with a reasonable threshold, gradually increasing it over time to avoid creating gates that always fail. Before deploying to production, an API test suite runs against the service to ensure integration and contract compliance. Lastly, the pipeline requires manual approval for deployment to the production branch, ensuring that human oversight is part of the process.

By implementing these gates, the pipeline effectively catches style issues, logic bugs, and integration problems early in the development cycle, reducing the likelihood of failures reaching production. Once the main branch is protected with a branch protection rule, requiring status checks to pass before merging, the gates provide a robust safeguard against subpar code entering the production environment.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in Tech

Audit-Ready CI/CD: What Regulated Industries Teach Us About Shipping Software

In many startups, a release is a merge and a deploy button. In a regulated industry like banking, every release must also answer a set of questions, often months later, from an auditor: Who approved…

  • Audit-ready CI/CD acts as compliance tool for regulated industries
  • Key principles: single production pathway, separation of duties, auto-generated evidence
  • Benefits apply to any organization, enhances incident response and onboarding

Node.js Uptime Health Monitoring API Explained (with Rollback-Safe Status Evidence)

TL;DR: A green Node.js status response is not enough evidence for a safe customer-support rollback. Keep app and job health as logs and metrics, preserve the release and request identifiers that let…

  • Health monitoring API should include release ID, operation name, outcome, timestamp, and request ID.
  • Separate heartbeat service detects stopped reporting of scheduled work.
  • Dead-man's switch ensures absence is observed by another system.

Scrape Etsy search results sorted by price: 10 rows for $0.065

Disclosure: I publish and maintain the Actor used here ( publicrecords/etsy-search-scraper on Apify Store). This is the publisher account.

  • Publicrecords/etsy-search-scraper actor used to scrape Etsy search results
  • Retrieved 10 cheapest ceramic mug listings priced between $10-$40
  • Total run cost $0.065, with each listing row costing $0.006

More from Monday 5 October →