introduce devcontainers #197
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
workflow_call: | |
env: | |
EM_VERSION: 3.1.44 | |
EM_CACHE_FOLDER: 'emsdk-cache' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build Package | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup cache | |
id: cache-system-libraries | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.EM_CACHE_FOLDER }} | |
key: ${{ env.EM_VERSION }}-${{ 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: Pack | |
run: npm pack | |
- name: Upload package | |
uses: actions/upload-artifact@v4 | |
with: | |
path: libxml2-wasm-*.tgz | |
compatibility: | |
needs: build | |
name: NodeJS/OS Compatibility Test | |
strategy: | |
matrix: | |
node: [16.20.2, 18.20.4, 20.15.1, 22.5.1] | |
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 | |
- name: Install libxml2-wasm | |
run: npm install ./artifact/libxml2-wasm-*.tgz | |
shell: bash | |
- name: Run Integration Test | |
run: npm run integ | |
result: | |
needs: compatibility | |
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') | |
}} |