Skip to content

test draft release #5178

test draft release

test draft release #5178

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests
name: Continuous Integration
on: push
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
version: [14, 16, 18, 20]
name: Build and test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
- run: yarn install --immutable
- run: yarn build
- name: Run yarn lint:ci
run: |
if ! yarn lint:ci ; then
echo "ESLint failed with the following errors:"
jq '.runs[].results' sarif-datadog-ci.sarif
echo ""
echo "Find the full SARIF report in the Artifacts section here: https://github.com/DataDog/datadog-ci/actions/runs/${{ github.run_id }}"
echo "You can fix this by running ==> yarn format <=="
echo ""
exit 1
fi
- run: yarn no-only-in-tests
- run: yarn test
env:
CI: true
DD_SERVICE: datadog-ci-tests
DD_CIVISIBILITY_AGENTLESS_ENABLED: 1
DD_API_KEY: ${{ secrets.DATADOG_API_KEY_MAIN_ACCOUNT }}
DD_APP_KEY: ${{ secrets.DATADOG_APP_KEY_MAIN_ACCOUNT }}
DD_ENV: ci
NODE_OPTIONS: -r dd-trace/ci/init
- run: mkdir artifacts
- run: yarn pack --filename artifacts/datadog-ci-${{ matrix.version }}.tgz
- run: cp -r .github/workflows/e2e artifacts/
- uses: actions/upload-artifact@v1
with:
name: artifacts
path: artifacts/
- uses: actions/upload-artifact@v3
if: always()
with:
name: sarif-datadog-ci.sarif
path: sarif-datadog-ci.sarif
if-no-files-found: error
e2e-test:
strategy:
matrix:
version: [14, 16, 18, 20]
name: End-to-end test the package
runs-on: ubuntu-latest
needs: build-and-test
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
- uses: actions/download-artifact@v1
with:
name: artifacts
- run: yarn add ./artifacts/datadog-ci-${{ matrix.version }}.tgz
- name: Run synthetics test
run: yarn datadog-ci synthetics run-tests --config artifacts/e2e/global.config.json
env:
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY_E2E }}
DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY_E2E }}
- name: Run sourcemaps upload test
run: yarn datadog-ci sourcemaps upload artifacts/e2e/sourcemaps/ --release-version=e2e --service=e2e-tests --minified-path-prefix=https://e2e-tests.datadoghq.com/static/
env:
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY_E2E }}
DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY_E2E }}
- name: Run junit upload test (measures)
run: yarn datadog-ci junit upload --service=datadog-ci-e2e-tests-junit artifacts/e2e/junit-reports --measures testmeasure1:20 --report-measures sessionmeasure1:40
env:
DD_API_KEY: ${{ secrets.DD_API_KEY_CI_VISIBILITY }}
- name: Check that test data can be queried (measures)
run: |
yarn add @datadog/datadog-api-client
yarn check-junit-upload
env:
EXTRA_TEST_QUERY_FILTER: '@testmeasure1:20'
EXTRA_SESSION_QUERY_FILTER: '@sessionmeasure1:40'
DD_API_KEY: ${{ secrets.DD_API_KEY_CI_VISIBILITY }}
DD_APP_KEY: ${{ secrets.DD_APP_KEY_CI_VISIBILITY }}
DD_SERVICE: datadog-ci-e2e-tests-junit
- name: Run junit upload test (metrics)
run: yarn datadog-ci junit upload --service=datadog-ci-e2e-tests-junit artifacts/e2e/junit-reports --metrics testmeasure2:60 --report-metrics sessionmeasure2:80
env:
DD_API_KEY: ${{ secrets.DD_API_KEY_CI_VISIBILITY }}
- name: Check that test data can be queried (metrics)
run: |
yarn add @datadog/datadog-api-client
yarn check-junit-upload
env:
EXTRA_TEST_QUERY_FILTER: '@testmeasure2:60'
EXTRA_SESSION_QUERY_FILTER: '@sessionmeasure2:80'
DD_API_KEY: ${{ secrets.DD_API_KEY_CI_VISIBILITY }}
DD_APP_KEY: ${{ secrets.DD_APP_KEY_CI_VISIBILITY }}
DD_SERVICE: datadog-ci-e2e-tests-junit
- name: Run sarif upload test
run: yarn datadog-ci sarif upload --service=datadog-ci-e2e-tests-sarif artifacts/e2e/sarif-reports
env:
DD_API_KEY: ${{ secrets.DD_API_KEY_CI_VISIBILITY }}
- name: Run sbom upload test
run: yarn datadog-ci sbom upload --service=datadog-ci-e2e-tests-sbom --env test artifacts/e2e/sbom-reports/sbom.json
env:
DD_API_KEY: ${{ secrets.DD_API_KEY_CI_VISIBILITY }}
DD_APP_KEY: ${{ secrets.DD_APP_KEY_CI_VISIBILITY }}
standalone-binary-test-ubuntu:
name: Test standalone binary in ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '14.18.3'
- run: yarn install --immutable
- run: yarn build
- name: Create standalone binary
run: yarn dist-standalone -t node14-linux-x64 -o datadog-ci_linux-x64
- name: Remove dist and src folder to check that binary can stand alone
run: |
rm -rf dist
rm -rf src
- name: Test generated standalone binary
run: yarn dist-standalone:test
standalone-binary-test-windows:
name: Test standalone binary in windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '14.18.3'
- run: yarn install --immutable
- run: yarn build:win
- name: Create standalone binary
run: yarn dist-standalone -t node14-win-x64 -o datadog-ci_win-x64
- name: Remove dist and src folder to check that binary can stand alone
run: |
rm dist -r
rm src -r
- name: Test generated standalone binary
run: yarn dist-standalone:test
standalone-binary-test-macos:
name: Test standalone binary in macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '14.18.3'
- run: yarn install --immutable
- run: yarn build
- name: Create standalone binary
run: yarn dist-standalone -t node14-macos-x64 -o datadog-ci_darwin-x64
- name: Remove dist and src folder to check that binary can stand alone
run: |
rm -rf dist
rm -rf src
- name: Test generated standalone binary
run: yarn dist-standalone:test
datadog-static-analyzer:
runs-on: ubuntu-latest
name: Datadog Static Analyzer
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Datadog static analyzer
id: datadog-static-analysis
uses: DataDog/datadog-static-analyzer-github-action@main
with:
dd_app_key: ${{ secrets.DATADOG_APP_KEY_MAIN_ACCOUNT }}
dd_api_key: ${{ secrets.DATADOG_API_KEY_MAIN_ACCOUNT }}
dd_service: 'datadog-ci'
dd_env: 'ci'
cpu_count: 2
enable_performance_statistics: true
sca_enabled: true
check-licenses:
name: Check licenses
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '14'
# The install step has been added here such that the `.yarn/install-state.gz` file is generated. This file is used
# by the script `check-licenses` below.
- run: yarn install --immutable
- run: yarn check-licenses