Added a test for ScanPoints #16
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: Publish to npm | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: docker build -t e57-js . | |
| - name: Compile WASM | |
| run: | | |
| mkdir -p build | |
| docker run --rm \ | |
| -v ${{ github.workspace }}:/src \ | |
| -w /src \ | |
| e57-js \ | |
| sh -c "mkdir -p build && cd build && emcmake cmake .. -DBUILD_TESTING=OFF && emmake make -j$(nproc)" | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: ${{ vars.NPM_REGISTRY_URL }} | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Bundle JavaScript | |
| run: node build.mjs | |
| - name: Run Sync tests | |
| run: node --test tests/io.test.js | |
| - name: Run Async tests | |
| run: node --test tests/io.async.test.js | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| publish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist/ | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: https://registry.npmjs.org/ | |
| - name: Publish | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |