rename all the things o/ #368
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: Build WASM | |
env: | |
V8_BRANCH: 11.2.60 | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
- v1.x | |
- v2.x | |
jobs: | |
check-versions: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- run: node scripts/version-checker.js | |
- run: node scripts/check_licenses.js | |
test-native: | |
strategy: | |
matrix: | |
target: | |
- name: linux 64 bits | |
os: ubuntu-latest | |
- name: windows 64 bits | |
os: windows-latest | |
- name: macos 64 bits | |
os: macos-latest | |
runs-on: ${{ matrix.target.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: test | |
run: | | |
cargo check | |
cargo test | |
wasm-pack: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- name: linux 64 bits | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- run: | | |
cargo install [email protected] | |
npm ci --ignore-scripts | |
npm run build | |
rm wasm/README.md wasm/package.json wasm/.gitignore | |
npm pack | |
- uses: codex-team/[email protected] | |
id: package | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: datadog-wasm-js-rewriter-${{ steps.package.outputs.version }} | |
path: '*.tgz' | |
static-checks: | |
strategy: | |
matrix: | |
run: | |
- lint | |
- clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
- run: npm ci | |
- run: npm run ${{ matrix.run }} | |
test-native-js: | |
needs: ['wasm-pack'] | |
strategy: | |
matrix: | |
target: | |
- name: linux 64 bits | |
os: ubuntu-latest | |
architecture: x64 | |
- name: windows 64 bits | |
os: windows-latest | |
architecture: x64 | |
- name: windows 32 bits | |
os: windows-latest | |
architecture: x86 | |
- name: macos 64 bits | |
os: macos-latest | |
architecture: x64 | |
runs-on: ${{ matrix.target.os }} | |
permissions: | |
checks: write | |
env: | |
NPM_REWRITER: true | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
architecture: ${{ matrix.target.arch }} | |
- run: npm ci --ignore-scripts | |
- uses: codex-team/[email protected] | |
id: package | |
- uses: actions/download-artifact@v3 | |
with: | |
name: datadog-wasm-js-rewriter-${{ steps.package.outputs.version }} | |
- run: npm i datadog-wasm-js-rewriter-${{ steps.package.outputs.version }}.tgz | |
- run: npm run test:junit | |
- run: npm run test:integration:ci | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v3 | |
if: always() | |
with: | |
report_paths: '**/build/junit*.xml' | |
check_name: junit test report ${{ matrix.target.name }} | |
test-docker: | |
needs: ['wasm-pack'] | |
runs-on: ubuntu-latest | |
permissions: | |
checks: write | |
strategy: | |
matrix: | |
target: | |
- name: alpine 64 bits | |
dockerfile: test.alpine.Dockerfile | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- uses: codex-team/[email protected] | |
id: package | |
- uses: actions/download-artifact@v3 | |
with: | |
name: datadog-wasm-js-rewriter-${{ steps.package.outputs.version }} | |
- run: docker build -t test -f ./docker/${{ matrix.target.dockerfile }} --build-arg NPM_VERSION=${{ steps.package.outputs.version }} . | |
- run: docker run --name tester test | |
- run: docker cp tester:/test/build/junit.xml ./junit.xml | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v3 | |
if: always() | |
with: | |
report_paths: '**/junit.xml' | |
check_name: junit test report ${{ matrix.target.name }} | |
compile-v8-and-run-tests: | |
needs: ['wasm-pack'] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: codex-team/[email protected] | |
id: package | |
- uses: actions/download-artifact@v3 | |
with: | |
name: datadog-wasm-js-rewriter-${{ steps.package.outputs.version }} | |
- name: Restore v8 builder Image | |
id: cache-docker-v8 | |
uses: actions/cache@v3 | |
with: | |
path: ci/cache/docker/v8builder | |
key: cache-docker-v8builder-${{ env.V8_BRANCH }} | |
- name: Update v8 builder Image Cache if cache miss | |
if: steps.cache-docker-v8.outputs.cache-hit != 'true' | |
run: docker build -t v8builder:${{ env.V8_BRANCH }} --build-arg V8_BRANCH=${{ env.V8_BRANCH }} -f ./docker/v8test-builder.Dockerfile . && mkdir -p ci/cache/docker/v8builder && docker image save v8builder:${{ env.V8_BRANCH }} --output ./ci/cache/docker/v8builder/v8builder-${{ env.V8_BRANCH }}.tar | |
- name: Use v8 builder Image Cache if cache hit | |
if: steps.cache-docker-v8.outputs.cache-hit == 'true' | |
run: docker image load --input ./ci/cache/docker/v8builder/v8builder-${{ env.V8_BRANCH }}.tar | |
- name: Rewrite and run v8 tests | |
id: run-tests | |
run: docker build -t v8tester:${{ env.V8_BRANCH }} --build-arg V8_BRANCH=${{ env.V8_BRANCH }} -f ./docker/v8test.Dockerfile . && docker run --name v8tester v8tester:${{ env.V8_BRANCH }} | |
- name: Rewrite summary | |
id: rewrite-summary | |
run: docker cp v8tester:/build/out/rewritingErrors.log ./rewritingErrors.log && cat ./rewritingErrors.log >> $GITHUB_STEP_SUMMARY | |
all-good: | |
needs: ['static-checks', 'test-native', 'test-native-js', 'test-docker', 'compile-v8-and-run-tests'] | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo 'πππππ' |