Add support for C14N #434
Workflow file for this run
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - 'releases/**' | |
| pull_request: | |
| workflow_call: | |
| env: | |
| EM_VERSION: 4.0.8 | |
| EM_CACHE_FOLDER: 'emsdk-cache' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| # permissions: | |
| # contents: write | |
| # pull-requests: write # for reporting coverage as comment of PR | |
| # repository-projects: write | |
| name: Build Package | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Cache Emscripten system libraries | |
| id: cache-system-libraries | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.EM_CACHE_FOLDER }} | |
| key: ${{ env.EM_VERSION }}-${{ runner.os }} | |
| - name: Cache node modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.npm | |
| key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
| restore-keys: | | |
| npm-${{ runner.os }}- | |
| - name: Setup Emcripten | |
| uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: ${{ env.EM_VERSION }} | |
| actions-cache-folder: ${{ env.EM_CACHE_FOLDER }} | |
| - name: Install npm packages | |
| run: npm ci | |
| - name: Build the library | |
| run: npm run build | |
| - name: Test | |
| run: npm run test | |
| - name: Save PR number | |
| if: ${{ github.event_name == 'pull_request' }} | |
| run: | | |
| mkdir -p coverage/pr | |
| echo ${{ github.event.number }} > coverage/pr/pr_num | |
| cp coverage/lcov.info coverage/pr | |
| - name: Upload coverage | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ github.event_name == 'pull_request' }} | |
| with: | |
| name: coverage-artifact | |
| path: coverage/pr | |
| retention-days: 1 # for coverage commenting, doesn't need to be long | |
| - name: Pack | |
| run: npm pack | |
| - name: Upload package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: libxml2-wasm-*.tgz | |
| compatibility_backend: | |
| needs: build | |
| name: NodeJS/OS Compatibility Test | |
| strategy: | |
| matrix: | |
| node: [18.20.8, 20.19.5, 22.20.0, 24.9.0] | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 # Run test only, don't need C source | |
| - name: Install nodeJs | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| - name: Install npm packages | |
| run: npm ci | |
| - name: Download libxml2-wasm | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: artifact | |
| - name: Install libxml2-wasm | |
| run: npm install ./libxml2-wasm-*.tgz | |
| shell: bash | |
| - name: Run Integration Test | |
| run: npm run integ:backend | |
| result: | |
| needs: compatibility_backend | |
| if: ${{ always() }} | |
| runs-on: ubuntu-latest | |
| name: Compatibility Test Result | |
| steps: | |
| - run: exit 1 | |
| if: >- | |
| ${{ | |
| contains(needs.*.result, 'failure') | |
| || contains(needs.*.result, 'cancelled') | |
| || contains(needs.*.result, 'skipped') | |
| }} |