-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: update GitHub Actions workflows for testing on LTS versions and specific OS * chore: update pr action * chore: update conditions * chore: changes * chore: changes * chore: changes * chore: allow github script to encode * chore: composite * chore: composit * fix: checkout first * chore: better names * chore: move tsd out * chore: trying out stuff * chore: trying out stuff * fix: add shell * chore: playing around with names * chore: job names * fix: codecov * chore: fixes * fix: oops * feat: codecov comments * chore: codecov comments * chore: update other workflows as well * fix: jsdoc updates --------- Co-authored-by: Giorgi Kotchlamazashvili <[email protected]>
- Loading branch information
Showing
12 changed files
with
300 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Setup Node + install deps | ||
|
||
inputs: | ||
nodeVersion: | ||
description: 'Node (* for latest or 20, 18, ...)' | ||
type: string | ||
default: '*' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
check-latest: true | ||
node-version: ${{ inputs.nodeVersion }} | ||
- uses: bahmutov/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Sudoless tcpdump | ||
|
||
inputs: | ||
runsOn: | ||
description: 'OS (ubuntu-latest, macos-latest, windows-latest, ...)' | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup sudoless tcpdump (linux only) | ||
if: ${{ success() && startsWith(inputs.runsOn, 'ubuntu-') }} | ||
shell: bash | ||
run: | | ||
sudo groupadd pcap | ||
sudo usermod -a -G pcap $USER | ||
sudo chgrp pcap /usr/bin/tcpdump | ||
sudo setcap cap_net_raw,cap_net_admin=eip /usr/bin/tcpdump | ||
- name: Setup sudoless tcpdump (macos only) | ||
if: ${{ success() && startsWith(inputs.runsOn, 'macos-') }} | ||
shell: bash | ||
run: | | ||
sudo chown $(whoami):admin /dev/bpf* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: 'test:lts-matrix' | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
testUnit: | ||
description: 'Units' | ||
type: choice | ||
options: | ||
- skip | ||
- test | ||
- test-with-coverage | ||
default: test | ||
testIntegration: | ||
description: 'Integrations' | ||
type: choice | ||
options: | ||
- skip | ||
- test | ||
default: test | ||
|
||
workflow_call: | ||
inputs: | ||
testUnit: | ||
type: string | ||
default: test | ||
testIntegration: | ||
type: string | ||
default: test | ||
|
||
jobs: | ||
ltsVersions: | ||
name: 'LTS Versions' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
nodeVersions: ${{ steps.nodeVersions.outputs.result }} | ||
steps: | ||
- uses: actions/[email protected] | ||
id: nodeVersions | ||
with: | ||
script: | | ||
const isNowWithin = (a, b) => { | ||
const toDateNumber = date => Number(date.split('-').join('')); | ||
const now = toDateNumber(new Date().toISOString().split('T')[0]); | ||
return toDateNumber(a) <= now && now <= toDateNumber(b); | ||
} | ||
const allVersions = await fetch('https://endoflife.date/api/node.json').then(r => r.json()); | ||
const version = allVersions.filter(v => v.lts).filter(v => isNowWithin(v.lts, v.eol)).map(v => v.cycle) | ||
return ['*', ...version] | ||
test-full: | ||
needs: | ||
- ltsVersions | ||
strategy: | ||
matrix: | ||
runsOn: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
nodeVersion: ${{ fromJson(needs.ltsVersions.outputs.nodeVersions) }} | ||
uses: ./.github/workflows/test-run.yaml | ||
with: | ||
nodeVersion: ${{ matrix.nodeVersion }} | ||
runsOn: ${{ matrix.runsOn }} | ||
testUnit: ${{ inputs.testUnit }} | ||
testIntegration: ${{ inputs.testIntegration }} | ||
secrets: inherit |
Oops, something went wrong.