
In Part 1 of this series we looked at Git fundamentals, branching and collaborative workflows. Here we continue with the same small project and add a layer of automation: a Makefile that downloads test data and runs the pipeline, an end-to-end test, and a GitHub Actions workflow.
Continuous integration (CI) and continuous delivery (CD) are terms borrowed from software engineering. Applied to a bioinformatics repository, they usually mean that every change re-runs the pipeline on a small dataset, so that a broken step is caught before it reaches a larger analysis. A useful side effect is that a fresh machine — or a server that has been wiped — can rebuild and re-run the work from the repository alone.
In this tutorial we will:
The example repository is committed step by step. Cloning it and checking out the branches is one way to follow how the work was developed.
# clonegit clone git@github.com:nttg8100/ngs-quality-control-for-blog-example.gitcd ngs-quality-control-for-blog-example
# checkout to branch for the relevant tutorial step, e.g. feature/add-datagit checkout feature/add-datagit log pager, type qGit provides commands to view the history and to compare two commits.
git logThe output looks roughly like this:
commit ca29351295a4148bda73b6bf76a42cc7b834d1b6 (HEAD -> feature/add-data, origin/feature/add-data)Author: <Author> <author@example.com>Date: Mon Jan 19 23:34:58 2026 +0700
feat: add makefile to get data
commit 70d584a726fb5418274448a4f51ca07d94b104be (origin/main, origin/HEAD, main, feature/testing-rebase)Merge: c731b9a 230795bAuthor: <Author> <author@example.com>Date: Sat Jan 17 16:42:11 2026 +0700
Merge pull request #1 from nttg8100/feature/environment-setup
feat: add pixi setup
commit 230795b7b8b03087ef7ee938d333161c9fcc0731 (origin/feature/environment-setup)Author: <Author> <author@example.com>Date: Sat Jan 17 15:05:28 2026 +0700
feat: add pixi setup
commit c731b9a80dfb22936bfcf94442bdf9b488a90d3c (feature/tesing-rebase)Author: <Author> <author@example.com>Date: Wed Jan 14 23:09:30 2026 +0700For a more compact overview:
git log --onelineThe one-line format is usually enough:
ca29351 (HEAD -> feature/add-data, origin/feature/add-data) feat: add makefile to get data70d584a (origin/main, origin/HEAD, main, feature/testing-rebase) Merge pull request #1 from nttg8100/feature/environment-setup230795b (origin/feature/environment-setup) feat: add pixi setupc731b9a (feature/tesing-rebase) Initial commitChecking out a specific commit is then a way to inspect the repository at an earlier point in the tutorial.
Using the commit hash is enough. For example, to see all files from commit 230795b:
git checkout 230795bThe editor then shows the files as they were at that commit.
If files have been changed but not yet committed:
git diffOne uncommitted change looks like this:
diff --git a/Makefile b/Makefileindex ae08113..c2e5b87 100644--- a/Makefile+++ b/Makefile@@ -10,4 +10,6 @@ data/GSE110004: wget https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/testdata/GSE110004/SRR6357070_2.fastq.gz
clean:- rm -rf data/GSE110004\ No newline at end of file+ rm -rf data/GSE110004++Change here\ No newline at end of fileTo compare two branches or commits:
git diff ca29351..70d584aThe changes between the two commits above:
diff --git a/.gitignore b/.gitignoreindex cfca1e8..1c3ecb3 100644--- a/.gitignore+++ b/.gitignore@@ -19,5 +19,3 @@ bin-release/ # pixi environments .pixi/* !.pixi/config.toml-data-diff --git a/Makefile b/Makefileindex ae08113..bcaa6d7 100644--- a/Makefile+++ b/Makefile@@ -1,13 +1,3 @@ ${HOME}/.pixi/bin/pixi: mkdir -p ${HOME}/.pixi/bin- curl -sSL https://pixi.dev/install.sh | sh---data/GSE110004:- mkdir -p data/GSE110004- cd data/GSE110004 && \- wget https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/testdata/GSE110004/SRR6357070_1.fastq.gz && \- wget https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/testdata/GSE110004/SRR6357070_2.fastq.gz--clean:- rm -rf data/GSE110004\ No newline at end of file+ curl -sSL https://pixi.sh/install.sh | sh\ No newline at end of fileIf a commit has been checked out and some exploratory changes were made, git will ask you to commit them before switching. Rolling back to the original version is straightforward:
git checkout -- .Sometimes only a single file is wanted from another branch:
git checkout <branch name> <relative file path># ex: git checkout main .gitignoreCreate a new branch from an updated main:
git checkout maingit pull origin maingit switch -c feature/add-dataWe now add a couple of targets to the Makefile that automate data download and cleanup:
data target: downloads example FASTQ files into the data/GSE110004 directory. Everyone working on the project then uses the same input data.clean target: removes the downloaded directory, which makes it easy to reset the environment or free disk space.An updated Makefile:
${HOME}/.pixi/bin/pixi: mkdir -p ${HOME}/.pixi/bin curl -sSL https://pixi.sh/install.sh | sh
data: mkdir -p data/GSE110004 wget -O data/GSE110004/SRR6351937_1.fastq.gz https://ftp.sra.ebi.ac.uk/vol1/fastq/SRR635/007/SRR6351937/SRR6351937_1.fastq.gz wget -O data/GSE110004/SRR6351937_2.fastq.gz https://ftp.sra.ebi.ac.uk/vol1/fastq/SRR635/007/SRR6351937/SRR6351937_2.fastq.gz
clean: rm -rf dataFollowing the same workflow as in Part 1, commit, push, open a pull request and merge to main:
git commit -m "feat: add makefile to get data"git push origin feature/add-dataCreate another branch:
git checkout maingit pullgit switch -c feature/workflowmain.sh workflow script and test itThe script below runs FastQC and MultiQC for one paired-end sample, taking its inputs as arguments.
# create workflow file using bash script, this runs for only paired reads of 1 samplecat << EOF >> main.sh#!/bin/bash
# Usage: ./main.sh <read1.fastq.gz> <read2.fastq.gz> <output_folder>
set -e
if [ "\$#" -ne 3 ]; then echo "Usage: $0 <read1.fastq.gz> <read2.fastq.gz> <output_folder>" exit 1fi
READ1="\$1"READ2="\$2"OUTDIR="\$3"
mkdir -p "\$OUTDIR"
echo "Running FastQC on \$READ1 and \$READ2..."fastqc "\$READ1" "\$READ2" -o "\$OUTDIR"
echo "Running MultiQC in \$OUTDIR..."multiqc "\$OUTDIR" -o "\$OUTDIR"
echo "All done. Results are in \$OUTDIR"EOF
# chmod to be executedchmod +x main.sh
# get help scriptbash main.sh# Usage: main.sh <read1.fastq.gz> <read2.fastq.gz> <output_folder>
# test it with your data# activate pixipixi shell# run interactivelybash main.sh data/GSE110004/*_1.fastq.gz data/GSE110004/*_2.fastq.gz result
# run with pixi directlypixi run bash main.sh data/GSE110004/*_1.fastq.gz data/GSE110004/*_2.fastq.gz result
Tests can then be run through the Makefile:
.PHONY: install-pixi test-e2e clean${HOME}/.pixi/bin/pixi: mkdir -p ${HOME}/.pixi/bin curl -sSL https://pixi.sh/install.sh | sh
data/GSE110004: mkdir -p data/GSE110004 cd data/GSE110004 && \ wget https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/testdata/GSE110004/SRR6357070_1.fastq.gz && \ wget https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/testdata/GSE110004/SRR6357070_2.fastq.gz
test-e2e: data/GSE110004 ${HOME}/.pixi/bin/pixi run bash main.sh data/GSE110004/*_1.fastq.gz data/GSE110004/*_2.fastq.gz result
clean: rm -rf data/GSE110004Run the test:
make test-e2eAdd the generated results to .gitignore so they are not committed:
# Build and Release Foldersbin-debug/bin-release/[Oo]bj/[Bb]in/
# Other files and folders.settings/
# Executables*.swf*.air*.ipa*.apk
# Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties`# should NOT be excluded as they contain compiler settings and other important# information for Eclipse / Flash Builder.# pixi environments.pixi/*!.pixi/config.tomldataresultCommit, push, open a pull request and merge to main as before:
git add .git commit -m "feat: add workflow"git push origin feature/workflowThen, from the repository root, download and check the data:
make clean removes more files and folders.git checkout# download datamake data# test that data is downloadedls -lah data/GSE110004# total 4.3M# drwxrwxr-x 2 <user> <group> 4.0K Jan 19 01:00 .# drwxrwxr-x 3 <user> <group> 4.0K Jan 19 01:00 ..# -rw-rw-r-- 1 <user> <group> 2.2M Jan 19 01:00 SRR6357070_1.fastq.gz# -rw-rw-r-- 1 <user> <group> 2.2M Jan 19 01:00 SRR6357070_2.fastq.gz
# delete data foldermake cleanSo far everything has been done locally. When a new feature is added — for example, adding trimmomatic to trim the reads — the test has to be run again to confirm that the pipeline still completes without errors. This is the simplest form of testing for a bioinformatics project.
GitHub Actions is one service that can run this test automatically:
Create a branch for CI/CD:
git checkout maingit pullgit switch -c feature/cicdThen create the workflow:
mkdir -p .github/workflows# create workflow filecat << EOF >> .github/workflows/test-e2e.yamlname: Testing e2e
on: push: branches: [ main ] pull_request: branches: [ main ]
jobs: clone: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4
- name: Running testing run: | make test-e2eEOFWhat this workflow does:
Testing e2emainmainubuntu-latest runneractions/checkoutmake test-e2eRunning tests only when a pull request is opened or a push reaches main can mean several small commits are needed just to trigger the test. act is a local command-line tool that runs a GitHub Actions workflow on the local machine instead, which shortens that loop:
act are at https://nektosact.com# installpixi add act# run e2e test locally, it will run this on your local machineact -W .github/workflows/test-e2e.yaml
As the log shows, the run failed because pixi was not installed: the make test-e2e target did not depend on the Pixi installation target. The Makefile in the earlier commit also pointed at an outdated installer URL (https://pixi.dev/install.sh); the current installer is https://pixi.sh/install.sh. Adding the Pixi installation as a dependency of test-e2e resolves the failure.
Update the test-e2e dependencies in the Makefile:
.PHONY: test-e2e clean${HOME}/.pixi/bin/pixi: mkdir -p ${HOME}/.pixi/bin curl -sSL https://pixi.sh/install.sh | sh
data/GSE110004: mkdir -p data/GSE110004 cd data/GSE110004 && \ wget https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/testdata/GSE110004/SRR6357070_1.fastq.gz && \ wget https://raw.githubusercontent.com/nf-core/test-datasets/rnaseq/testdata/GSE110004/SRR6357070_2.fastq.gz
test-e2e: data/GSE110004 ${HOME}/.pixi/bin/pixi ${HOME}/.pixi/bin/pixi run bash main.sh data/GSE110004/*_1.fastq.gz data/GSE110004/*_2.fastq.gz result
clean: rm -rf data/GSE110004Re-running act then completes successfully:
CI (continuous integration) and CD (continuous delivery/deployment) are commonly used software-development terms. In the diagram above, software development proceeds through many new features, each of which triggers a set of jobs. In the example used here, the workflow clones the repository on a GitHub Actions runner and runs the tests. The exact jobs depend on the project's use cases.
A bioinformatics project that develops software follows the same general CI/CD process. More often, however, bioinformatics combines existing tools: scripts (bash, Nextflow, WDL, Snakemake, and so on) chain tools into a workflow. In that setting the release is often the repository itself, with the scripts inside it (CD), while CI is the pipeline that runs on a testing dataset.
Once the workflow is in place, opening a pull request triggers the test, which reports whether the change is likely to break the pipeline:
Settings for credentials (passwords, usernames, keys)The GitHub Actions logs are the place to look when a run fails:
This walkthrough turned a small bioinformatics project into a reproducible, testable pipeline using Git, a Makefile and GitHub Actions. The main points:
git log and git log --oneline show the commit historygit diff compares the working tree with a commit, or two commits with each othergit checkout -- . rolls back the working treegit checkout <branch> <file> copies a file from another branchmake data) and cleanup (make clean)make test-e2e) that chains its dependencies.github/workflows/main or on pull requestsactact runs a GitHub Actions workflow locallyA project structured this way is easier to reproduce on another machine, to test automatically, and to maintain over time.
nektos/act repository: github.com/nektos/actact documentation: nektosact.com



