Jenkins is powerful but requires maintenance. You need a server, you need to update plugins, you need to manage disk space. GitHub Actions is built into GitHub — zero infrastructure. You write a YAML file, push it to your repo, and tests run automatically. No server needed.
| Jenkins | GitHub Actions |
|---|---|
| Self-hosted — you manage the server | Cloud-hosted — GitHub manages everything |
| Groovy-based Jenkinsfile | YAML-based workflow files |
| 1800+ plugins | Marketplace with thousands of actions |
| Full control over infrastructure | Limited to GitHub runners (or self-hosted) |
| Complex setup, steep learning curve | Simple setup, gentle learning curve |
| Free forever (you pay for server) | Free for public repos (2000 min/month for private) |
| Industry standard in enterprises | Growing fast, popular in startups/open-source |
# .github/workflows/selenium-tests.yml
name: Selenium Test Suite
# WHEN to run
on:
push:
branches: [main] # Run on push to main
pull_request:
branches: [main] # Run on PRs targeting main
schedule:
- cron: '0 2 * * 1-5' # Nightly regression at 2 AM UTC on weekdays
workflow_dispatch: # Manual trigger button in GitHub UI
inputs:
browser:
type: choice
description: Browser
options: [chrome, firefox]
suite:
type: choice
description: Test Suite
options: [testng-smoke.xml, testng-regression.xml, testng.xml]
# WHAT to run
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven # Cache Maven dependencies
- name: Set up Chrome
uses: browser-actions/setup-chrome@v1
- name: Run tests
run: |
mvn test \
-DsuiteXmlFile=${{ github.event.inputs.suite || 'testng-smoke.xml' }} \
-Dbrowser=${{ github.event.inputs.browser || 'chrome' }} \
-Dheadless=true
- name: Upload test results
if: always() # Upload even if tests fail
uses: actions/upload-artifact@v4
with:
name: test-results
path: |
target/surefire-reports/
target/allure-results/
target/screenshots/
- name: Publish TestNG results
if: always()
uses: dorny/test-reporter@v1
with:
name: TestNG Results
path: target/surefire-reports/testng-results.xml
reporter: java-junit| Concept | Jenkins | GitHub Actions |
|---|---|---|
| Config file | Jenkinsfile | .github/workflows/*.yml |
| Language | Groovy | YAML |
| Trigger on push | triggers { pollSCM() } | on: push: |
| Cron schedule | triggers { cron("H 2 * * 1-5") } | on: schedule: - cron: "0 2 * * 1-5" |
| Manual trigger | Build with Parameters | workflow_dispatch with inputs |
| Install Java | tools { jdk "JDK-17" } | uses: actions/setup-java@v4 |
| Run command | sh "mvn test" | run: mvn test |
| Archive artifacts | archiveArtifacts | uses: actions/upload-artifact@v4 |
Learn both Jenkins and GitHub Actions. In interviews, say "I primarily use Jenkins for our enterprise CI, but I am also comfortable with GitHub Actions. The concepts are the same — triggers, stages, reports, notifications — just different syntax." This makes you versatile.
Q: Have you used any CI/CD tool other than Jenkins?
A: Yes, I have used GitHub Actions for projects hosted on GitHub. The concepts are identical — triggers, stages, reports, notifications — but the syntax is YAML instead of Groovy. GitHub Actions is simpler to set up since there is no server to manage. I created workflows that run smoke tests on every PR and full regression nightly. The workflow uses setup-java and setup-chrome actions, runs mvn test in headless mode, and uploads test artifacts. I prefer Jenkins for enterprise projects because of its plugin ecosystem and infrastructure control, but GitHub Actions is great for smaller teams and open-source projects.
Key Point: GitHub Actions is a zero-infrastructure alternative to Jenkins. YAML-based, built into GitHub, same CI/CD concepts. Learn both.