From 5aa2949d751a41d5c4b788723a5f7d6e3263e2f1 Mon Sep 17 00:00:00 2001 From: "GLM-5.2 prompted by Jesse Bickel" Date: Fri, 31 Jul 2026 08:46:54 -0500 Subject: [PATCH] Consolidate CI workflows Our other PDC repositories use a single consolidated CI workflow file, which keeps CI checks distinct from other workflows we may add. The previous lint, check-types, and test workflows each ran a single job; this combines them as jobs in one ci.yml, adds an actionlint job and a lockfile-sync check, enables npm caching on the Node jobs, and cancels superseded runs on PRs. Prior behavior is preserved: the build job compiles tsconfig.json (the former check-types command) and the tsc job adds dev/test type-checking. Mirrors PhilanthropyDataCommons/http-status-codes#24 --- .github/workflows/check-types.yml | 16 ------ .github/workflows/ci.yml | 87 +++++++++++++++++++++++++++++++ .github/workflows/lint.yml | 16 ------ .github/workflows/test.yml | 16 ------ 4 files changed, 87 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/check-types.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/check-types.yml b/.github/workflows/check-types.yml deleted file mode 100644 index 93295df..0000000 --- a/.github/workflows/check-types.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Check Types -on: - pull_request: - push: -jobs: - check_types: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version-file: ".node-version" - - name: Install dependencies - run: npm ci - - name: Check types - run: tsc -p tsconfig.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b80ddec --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - name: Lint GitHub Action workflows + uses: raven-actions/actionlint@v2 + + npm-install: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .node-version + cache: npm + - run: npm install --package-lock-only --ignore-scripts --no-audit --no-fund + - run: git diff --exit-code -- package-lock.json + + eslint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .node-version + cache: npm + - run: npm ci + - run: npm run lint:eslint + + prettier: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .node-version + cache: npm + - run: npm ci + - run: npm run lint:prettier + + tsc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .node-version + cache: npm + - run: npm ci + - run: npm run lint:tsc + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .node-version + cache: npm + - run: npm ci + - run: npm run build + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-node@v7 + with: + node-version-file: .node-version + cache: npm + - run: npm ci + - run: npm test diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 4961e27..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Lint -on: - pull_request: - push: -jobs: - run_lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version-file: ".node-version" - - name: Install dependencies - run: npm ci - - name: Run ESLint - run: npm run lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 2dee730..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Test -on: - pull_request: - push: -jobs: - run_tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-node@v6 - with: - node-version-file: ".node-version" - - name: Install dependencies - run: npm ci - - name: Run tests - run: npm test