Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,30 @@ on:
branches:
- 'main'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

env:
CI: true

jobs:
pullRequestBuild:
name: Pull Request Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['24.x', '25.x']
node-version: ['24.x', '26.x']
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install latest npm
run: npm install -g npm@11.4.2
- name: Install Latest npm
run: npm install --global npm@latest
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Prepare
Expand All @@ -35,26 +42,26 @@ jobs:
- name: Run Tests
run: npm run ci:test
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

branchBuild:
name: Branch Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['24.x', '25.x']
node-version: ['24.x', '26.x']
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install latest npm
run: npm install -g npm@11.4.2
- name: Install Latest npm
run: npm install --global npm@latest
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Prepare
Expand All @@ -68,4 +75,4 @@ jobs:
- name: Run Tests
run: npm run ci:test
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
matrix:
language: ['javascript']
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout Code
uses: actions/checkout@v7
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v4
93 changes: 73 additions & 20 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,94 @@ name: Coverage

on:
pull_request:
branches:
- 'main'
branches: [main]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read

env:
CI: true

jobs:
coverage:
name: Coverage
base:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js
uses: actions/setup-node@v4
ref: ${{ github.event.pull_request.base.sha }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '24.x'
node-version: '26.x'
cache: 'npm'
- name: Install latest npm
run: npm install -g npm@11.4.2
run: npm install --global npm@latest
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Prepare
run: npm run prepare
- name: Calculate Code Coverage
run: npm run ci:coverage
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH }}
- name: Create Coverage Report for base branch
run: |
mv coverage coverage-pr
git fetch
git checkout origin/${{ github.event.pull_request.base.ref }}
npm ci --ignore-scripts && npm run prepare && npm run ci:coverage
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Upload Base Coverage
uses: actions/upload-artifact@v7
with:
name: base-coverage
path: coverage/lcov.info
if-no-files-found: error

pr:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v7
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '26.x'
cache: 'npm'
- name: Install Latest npm
run: npm install --global npm@latest
- name: Install Dependencies
run: npm ci --ignore-scripts
- name: Calculate Code Coverage
run: npm run ci:coverage
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Upload PR Coverage
uses: actions/upload-artifact@v7
with:
name: pr-coverage
path: coverage/lcov.info
if-no-files-found: error

report:
name: Coverage
needs: [base, pr]
if: ${{ always() }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Require Successful Coverage Jobs
if: ${{ needs.base.result != 'success' || needs.pr.result != 'success' }}
run: exit 1
- name: Download Base Coverage
uses: actions/download-artifact@v8
with:
name: base-coverage
path: coverage
- name: Download PR Coverage
uses: actions/download-artifact@v8
with:
name: pr-coverage
path: coverage-pr
- name: Post Coverage Report
uses: checkdigit/github-actions/coverage-reporter@main
with:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 checkdigit
Copyright (c) 2026 checkdigit

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# github-actions
# @checkdigit/github-actions

Github actions supporting CI workflows.

Copyright (c) 2021-2026 [Check Digit, LLC](https://checkdigit.com)

## License

MIT
Loading
Loading