2020-09-05 12:43:05 +00:00
|
|
|
name: Tester
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tester:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
2024-06-04 08:52:45 +00:00
|
|
|
node-version: ["18", "20", "22"]
|
2020-09-05 12:43:05 +00:00
|
|
|
fail-fast: false
|
|
|
|
steps:
|
2023-10-01 04:48:01 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-09-05 12:43:05 +00:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2023-10-24 15:47:02 +00:00
|
|
|
uses: actions/setup-node@v4
|
2020-09-05 12:43:05 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Cache NPM dependencies
|
2024-01-18 15:37:36 +00:00
|
|
|
uses: actions/cache@v4
|
2020-09-05 12:43:05 +00:00
|
|
|
with:
|
|
|
|
path: node_modules
|
|
|
|
key: ${{ runner.os }}-npm-cache
|
|
|
|
restore-keys: ${{ runner.os }}-npm-cache
|
|
|
|
- name: Install Dependencies
|
2024-06-11 12:06:41 +00:00
|
|
|
run: npm install
|
|
|
|
- name: Determine zstd binary version
|
|
|
|
shell: bash
|
2024-06-11 11:19:32 +00:00
|
|
|
run: |
|
2024-06-11 12:06:41 +00:00
|
|
|
case "$RUNNER_OS" in
|
|
|
|
"Linux")
|
|
|
|
echo "PLATFORM=linux-x64-gnu" >> "$GITHUB_ENV" ;;
|
|
|
|
"Windows")
|
|
|
|
echo "PLATFORM=win32-x64-msvc" >> "$GITHUB_ENV" ;;
|
|
|
|
"macOS")
|
|
|
|
echo "PLATFORM=darwin-arm64" >> "$GITHUB_ENV" ;;
|
|
|
|
esac
|
|
|
|
- name: Install zstd binary
|
2024-06-11 12:37:53 +00:00
|
|
|
shell: bash
|
2024-06-11 12:22:08 +00:00
|
|
|
run: npm install "@mongodb-js/zstd-$PLATFORM"
|
2020-09-05 12:43:05 +00:00
|
|
|
- name: Test
|
|
|
|
run: npm run test
|
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
coverage:
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
2023-12-12 08:33:33 +00:00
|
|
|
node-version: ["20.x"]
|
2020-09-05 12:43:05 +00:00
|
|
|
steps:
|
2023-10-01 04:48:01 +00:00
|
|
|
- uses: actions/checkout@v4
|
2020-09-05 12:43:05 +00:00
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2023-10-24 15:47:02 +00:00
|
|
|
uses: actions/setup-node@v4
|
2020-09-05 12:43:05 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
2023-10-01 04:05:08 +00:00
|
|
|
- name: Install Bun
|
|
|
|
uses: oven-sh/setup-bun@v1
|
2020-09-05 12:43:05 +00:00
|
|
|
- name: Cache NPM dependencies
|
2024-01-18 15:37:36 +00:00
|
|
|
uses: actions/cache@v4
|
2020-09-05 12:43:05 +00:00
|
|
|
with:
|
|
|
|
path: node_modules
|
|
|
|
key: ${{ runner.os }}-npm-cache
|
|
|
|
restore-keys: ${{ runner.os }}-npm-cache
|
|
|
|
- name: Install Dependencies
|
2023-10-01 04:05:08 +00:00
|
|
|
run: bun install
|
2020-09-05 12:43:05 +00:00
|
|
|
- name: Coverage
|
|
|
|
run: npm run test
|
|
|
|
env:
|
|
|
|
CI: true
|
|
|
|
- name: Upload coverage report to Codecov
|
2024-02-01 15:46:21 +00:00
|
|
|
uses: codecov/codecov-action@v4
|
2020-09-05 12:43:05 +00:00
|
|
|
with:
|
|
|
|
fail_ci_if_error: true
|
2024-06-05 09:05:39 +00:00
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|