Merge pull request #23 from serpapi/fix-22-multibyte-char-corruption #261
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: Build | |
on: [push] | |
jobs: | |
build: | |
name: "Deno tests and build npm files" | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Deno | |
uses: denoland/[email protected] | |
with: | |
deno-version: v1.x | |
- name: Check formatting | |
run: deno fmt --check | |
- name: Run linter | |
run: deno lint | |
- name: Run tests | |
env: | |
SERPAPI_TEST_KEY: ${{ secrets.SERPAPI_TEST_KEY }} | |
run: deno task test:ci | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' # Build files using a fixed node version | |
registry-url: 'https://registry.npmjs.org' | |
- name: Build npm files | |
run: deno task npm | |
- name: Zip build files | |
run: zip npm.zip ./npm -r | |
- name: Upload build files for smoke tests | |
uses: actions/upload-artifact@v3 | |
with: | |
name: npm | |
path: npm.zip | |
retention-days: 1 | |
smoke-tests-commonjs: | |
name: "Smoke tests (CommonJS)" | |
needs: build | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
node-version: [7.x, 8.x, 9.x, 10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x, 17.x, 18.x, 19.x] | |
include: | |
- command: test | |
- command: test:use-openssl-ca | |
node-version: 7.x | |
- command: test:use-openssl-ca | |
node-version: 8.x | |
- command: test:use-openssl-ca | |
node-version: 9.x | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: 'https://registry.npmjs.org' | |
- name: Download build files | |
uses: actions/download-artifact@v3 | |
with: | |
name: npm | |
- name: Unzip build files | |
run: unzip npm.zip | |
- name: Run smoke tests | |
env: | |
SERPAPI_TEST_KEY: ${{ secrets.SERPAPI_TEST_KEY }} | |
run: | | |
cd smoke_tests/commonjs | |
npm i | |
npm run ${{ matrix.command }} | |
smoke-tests-esm: | |
name: "Smoke tests (ESM)" | |
needs: build | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
node-version: [14.x, 15.x, 16.x, 17.x, 18.x, 19.x] | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
registry-url: 'https://registry.npmjs.org' | |
- name: Download build files | |
uses: actions/download-artifact@v3 | |
with: | |
name: npm | |
- name: Unzip build files | |
run: unzip npm.zip | |
- name: Run smoke tests | |
env: | |
SERPAPI_TEST_KEY: ${{ secrets.SERPAPI_TEST_KEY }} | |
run: | | |
cd smoke_tests/esm | |
npm i | |
npm test |