diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..89f651e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + runs-on: ubuntu-latest + + name: Lint ${{ matrix.lint-target }} + strategy: + matrix: + lint-target: ["c++", "typescript"] + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: "Build libmongocrypt" + shell: bash + run: | + node .github/scripts/libmongocrypt.mjs + npm install + npm run prebuild + + - if: matrix.lint-target == 'c++' + shell: bash + run: | + npm run check:clang-format + + - if: matrix.lint-target == 'typescript' + shell: bash + run: | + npm run check:eslint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..880c9c3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + name: Test (Node ${{ matrix.node-version }}) + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x, 18.x, 20.x] + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: "Build libmongocrypt" + shell: bash + run: | + node .github/scripts/libmongocrypt.mjs + npm install + npm run prebuild + - run: npm test +