ci: add GitHub Actions workflow (build + test on Node 18/20/22) #1
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: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18, 20, 22] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install dependencies | |
| working-directory: packages/trail-core | |
| run: npm install | |
| - name: Build | |
| working-directory: packages/trail-core | |
| run: npx tsc | |
| - name: Run tests | |
| working-directory: packages/trail-core | |
| run: node --test dist/test/roundtrip.test.js |