Skip to content
Merged
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
6 changes: 5 additions & 1 deletion .github/workflows/code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ on:
pull_request:

jobs:
node-versions:
uses: ./.github/workflows/get-supported-node-versions.yml

check-code-quality:
name: Check code quality
runs-on: ubuntu-latest
needs: node-versions

steps:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 12
node-version: ${{ needs.node-versions.outputs.default-version }}
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/code_sample_checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ name: Code sample checker
on: pull_request

jobs:
node-versions:
uses: ./.github/workflows/get-supported-node-versions.yml

test-code-samples:
name: Check code samples
runs-on: ${{matrix.os}}
needs: node-versions

strategy:
matrix:
Expand All @@ -23,7 +27,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 10
node-version: ${{ needs.node-versions.outputs.default-version }}
- name: Install dependencies and compile client
run: |
npm install
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/coverage_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,14 @@ jobs:
member-name: ${{ github.actor }}
token: ${{ secrets.PAT }}

node-versions:
uses: ./.github/workflows/get-supported-node-versions.yml

run-tests:
name: Run Tests on (${{ matrix.os }})
needs: [check_for_membership]
needs:
- check_for_membership
- node-versions
if: github.event_name == 'push' || needs.check_for_membership.outputs.check-result == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -64,7 +69,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 10
node-version: ${{ needs.node-versions.outputs.default-version }}

- name: Checkout to test artifacts
uses: actions/checkout@v4
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/get-supported-node-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Get supported Node.js versions

on:
workflow_call:
outputs:
node-versions:
value: ${{ jobs.get-supported-node-versions.outputs.node-versions }}
default-version:
value: ${{ jobs.get-supported-node-versions.outputs.default-version }}

jobs:
get-supported-node-versions:
runs-on: ubuntu-latest
outputs:
node-versions: ${{ steps.get_versions.outputs.node-versions }}
default-version: ${{ steps.get_versions.outputs.default-version }}
steps:
- name: Get supported Node.js versions
id: get_versions
run: |
# Look for versions that are:
# - Currently supported
# - That are LTS
# - Within LTS date range (i.e. not future LTS)
NODE_VERSIONS=$(curl --silent https://raw.githubusercontent.com/nodejs/Release/main/schedule.json | jq --compact-output '
def today: now | strftime("%Y-%m-%d");
to_entries
| map(select(.value.end > today and .value.lts != null and .value.lts < today))
| [.[0].key, .[-1].key]
| unique
')

echo "node-versions=${NODE_VERSIONS}" >> ${GITHUB_OUTPUT}
# Default to using the newest version
echo "default-version=$(jq -r '.[1]' <<< ${NODE_VERSIONS})" >> ${GITHUB_OUTPUT}
6 changes: 5 additions & 1 deletion .github/workflows/nightly_runner_maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ on:
schedule:
- cron: '0 2 */2 * *'
jobs:
node-versions:
uses: ./.github/workflows/get-supported-node-versions.yml

run-tests:
runs-on: ${{ matrix.os }}
needs: node-versions
name: Run tests of branch ${{ matrix.branch }} on ${{ matrix.os }} with Node ${{ matrix.nodejs_version }}
strategy:
matrix:
branch: [ 5.0.x, 4.2.x, 4.1.x, 4.0.x ]
os: [ ubuntu-latest, windows-latest ]
nodejs_version: [ 10, 18 ]
nodejs_version: ${{ fromJSON(needs.node-versions.outputs.node-versions) }}
fail-fast: false
steps:
- name: Setup Java
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/nightly_runner_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ on:
schedule:
- cron: '0 2 * * *'
jobs:
node-versions:
uses: ./.github/workflows/get-supported-node-versions.yml

run-tests:
runs-on: ${{ matrix.os }}
needs: node-versions
name: Run tests of master on ${{ matrix.os }} with Node ${{ matrix.nodejs_version }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
nodejs_version: [ 10, 18 ]
nodejs_version: ${{ fromJSON(needs.node-versions.outputs.node-versions) }}
fail-fast: false
steps:
- name: Checkout code
Expand Down
Loading