
23 GitHub Actions Workflows for Development Teams
As a development team, you’re always looking for ways to streamline your workflow, improve collaboration, and reduce errors. That’s where GitHub Actions comes in – a powerful automation tool that helps you build, test, and deploy software with ease.
In this article, we’ll explore 23 GitHub Actions workflows that can supercharge your development process. From code review to deployment, these workflows will help you save time, increase efficiency, and focus on what matters most – building great software.
Workflow 1: Code Review
Automate code review by running linters and formatters on PRs.
“`yaml
name: Code Review
on:
pull_request:
jobs:
code_review:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run linter and formatter
run: |
npm install -g eslint && eslint .
prettier –write .
“`
Workflow 2: Testing
Run automated tests on PRs to catch bugs early.
“`yaml
name: Testing
on:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run tests
run: |
npm install && npm test
“`
Workflow 3: Deployment
Automate deployment to production using a CI/CD pipeline.
“`yaml
name: Deployment
on:
push:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Deploy to prod
run: |
npm install && npm run deploy
“`
Workflow 4: Security Scanning
Run security scans on PRs to identify potential vulnerabilities.
“`yaml
name: Security Scanning
on:
pull_request:
jobs:
scan:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run security scanner
run: |
npm install -g snyk && snyk test
“`
Workflow 5: Code Coverage
Run code coverage analysis on PRs to ensure high-quality code.
“`yaml
name: Code Coverage
on:
pull_request:
jobs:
cover:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run code coverage
run: |
npm install && npm run cov
“`
Workflow 6: Dependency Updates
Automate dependency updates on PRs to ensure up-to-date packages.
“`yaml
name: Dependency Updates
on:
pull_request:
jobs:
update:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run dependency updates
run: |
npm install && npm update
“`
Workflow 7: Code Formatting
Run code formatters on PRs to ensure consistent formatting.
“`yaml
name: Code Formatting
on:
pull_request:
jobs:
format:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run code formatter
run: |
npm install -g prettier && prettier –write .
“`
Workflow 8: Linting
Run linters on PRs to catch syntax errors and inconsistencies.
“`yaml
name: Linting
on:
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run linter
run: |
npm install -g eslint && eslint .
“`
Workflow 9: Code Duplication
Detect code duplication on PRs to ensure original ideas.
“`yaml
name: Code Duplication
on:
pull_request:
jobs:
dup:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run code duplication detector
run: |
npm install -g codimd && codimd .
“`
Workflow 10: Performance Optimization
Run performance optimization tools on PRs to improve app speed.
“`yaml
name: Performance Optimization
on:
pull_request:
jobs:
perf:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run performance optimizers
run: |
npm install && npm run perf
“`
Workflow 11: Accessibility Auditing
Run accessibility audits on PRs to ensure app usability.
“`yaml
name: Accessibility Auditing
on:
pull_request:
jobs:
acc:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run accessibility audit
run: |
npm install -g a11y && a11y .
“`
Workflow 12: Code Documentation
Run code documentation tools on PRs to ensure up-to-date comments.
“`yaml
name: Code Documentation
on:
pull_request:
jobs:
doc:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run code documentation tool
run: |
npm install && npm run doc
“`
Workflow 13: Code Complexity Analysis
Run code complexity analysis tools on PRs to ensure maintainable code.
“`yaml
name: Code Complexity Analysis
on:
pull_request:
jobs:
comp:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run code complexity analysis tool
run: |
npm install && npm run comp
“`
Workflow 14: Security Hardening
Run security hardening tools on PRs to ensure secure apps.
“`yaml
name: Security Hardening
on:
pull_request:
jobs:
sec:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run security hardening tool
run: |
npm install && npm run sec
“`
Workflow 15: Code Review with Comments
Run code review tools on PRs to ensure thorough comments.
“`yaml
name: Code Review with Comments
on:
pull_request:
jobs:
cr:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run code review tool with comments
run: |
npm install && npm run cr –comments
“`
Workflow 16: Dependency Scanning
Run dependency scanning tools on PRs to ensure secure dependencies.
“`yaml
name: Dependency Scanning
on:
pull_request:
jobs:
dep:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run dependency scanner
run: |
npm install && npm run dep
“`
Workflow 17: Code Coverage with Mutations
Run code coverage tools on PRs to ensure thorough testing.
“`yaml
name: Code Coverage with Mutations
on:
pull_request:
jobs:
cov:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run code coverage tool with mutations
run: |
npm install && npm run cov –mutations
“`
Workflow 18: Performance Benchmarking
Run performance benchmarking tools on PRs to ensure app speed.
“`yaml
name: Performance Benchmarking
on:
pull_request:
jobs:
perf-bm:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run performance benchmarking tool
run: |
npm install && npm run perf-bm
“`
Workflow 19: Code Review with Static Analysis
Run static analysis tools on PRs to ensure clean code.
“`yaml
name: Code Review with Static Analysis
on:
pull_request:
jobs:
cr-sa:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run static analysis tool
run: |
npm install && npm run cr –sa
“`
Workflow 20: Code Review with Dynamic Analysis
Run dynamic analysis tools on PRs to ensure app correctness.
“`yaml
name: Code Review with Dynamic Analysis
on:
pull_request:
jobs:
cr-da:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run dynamic analysis tool
run: |
npm install && npm run cr –da
“`
Workflow 21: Code Review with Fuzzing
Run fuzzing tools on PRs to ensure app robustness.
“`yaml
name: Code Review with Fuzzing
on:
pull_request:
jobs:
cr-fz:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run fuzzing tool
run: |
npm install && npm run cr –fz
“`
Workflow 22: Code Review with Concolic Execution
Run concolic execution tools on PRs to ensure app correctness.
“`yaml
name: Code Review with Concolic Execution
on:
pull_request:
jobs:
cr-ce:
runs-on: ubuntu-latest
steps:
– name: Checkout code
uses: actions/checkout@v2
– name: Run concolic execution tool
run: |
npm install && npm run cr –ce
“`
These workflows are designed to be customizable and can be tailored to fit the specific needs of your project. By combining these workflows, you can ensure that your code is thoroughly reviewed, tested, and maintained throughout its entire lifecycle.