Update README.md #1118
Workflow file for this run
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
name: Tracer Testing | |
on: [push] | |
jobs: | |
build-package: | |
name: Validation ${{ matrix.npm-task }} | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
strategy: | |
fail-fast: false # We don't want linting to prevent unit testing | |
matrix: | |
npm-task: ['prettier:ci', 'lint', 'test:unit', 'build'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
architecture: x64 | |
- run: sudo apt-get update && sudo apt-get install build-essential libsdl-pango-dev libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev || true # Node.js 18 does not carry pango | |
- run: npm ci | |
- run: npm run ${{ matrix.npm-task }} | |
- name: Upload distro as artifact | |
uses: actions/upload-artifact@v4 | |
if: ${{ matrix.npm-task == 'build' }} | |
with: | |
name: distro-package | |
path: distro.tgz | |
retention-days: 5 | |
instrumentations-to-test: | |
name: List instrumentations to test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- id: list_instrumentations | |
run: | | |
instrumentations_as_json_list=$(ls -1 test/instrumentations | jq --raw-input --slurp 'split("\n") | map(select(. != ""))' | jq -r tostring) | |
echo "instrumentations=${instrumentations_as_json_list}" >> "${GITHUB_OUTPUT}" | |
echo "instrumentations=${instrumentations_as_json_list}" | |
outputs: | |
instrumentations: ${{ steps.list_instrumentations.outputs.instrumentations }} | |
supported-node-versions-testing: | |
name: 'Node ${{ matrix.node_cimg_tag }} ${{ matrix.instrumentations_to_test }} tests' | |
runs-on: ubuntu-latest | |
needs: [build-package, instrumentations-to-test] | |
strategy: | |
fail-fast: false # We want to see all tests being tried, rather than stop when the first fails | |
matrix: | |
node_cimg_tag: [ 14, 16, 18, 20 ] | |
instrumentations_to_test: ${{ fromJson(needs.instrumentations-to-test.outputs.instrumentations) }} | |
steps: | |
- name: Set Swap Space | |
uses: pierotofy/set-swap-space@master | |
with: | |
# see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners for | |
# runner specs, default swap space is only 2GB | |
swap-size-gb: 10 | |
- uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node_cimg_tag }} | |
architecture: x64 | |
- run: sudo apt-get update && sudo apt-get install build-essential libsdl-pango-dev libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev || true # Node.js 18 does not carry pango | |
- run: npm ci | |
- run: npm run test:instrumentations:ci | |
env: | |
INSTRUMENTATION_UNDER_TEST: ${{ matrix.instrumentations_to_test }} | |
unsupported-node-versions-testing: | |
name: 'Node ${{ matrix.node_cimg_tag }} unsupported' | |
runs-on: ubuntu-latest | |
needs: [build-package] | |
strategy: | |
matrix: | |
node_cimg_tag: [ 12 ] | |
steps: | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node_cimg_tag }} | |
architecture: x64 | |
- name: Download distro | |
uses: actions/download-artifact@v4 | |
continue-on-error: true # when there aren't changes the artifact won't be uploaded and this step will fail | |
with: | |
name: distro-package | |
- run: npm i ./distro.tgz | |
- run: | | |
output=$(node -e "require('@lumigo/opentelemetry')" 2>&1) | |
if [[ "${output}" != "@lumigo/opentelemetry: Node.js version '$(node --version)' is not supported"* ]]; then | |
echo "Unexpected output: ${output}" | |
exit 1 | |
fi |