refactor: drop old interface and fix test code (#58) #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: tester | |
on: | |
push: | |
branches: ["master"] | |
paths: | |
- "lib/**" | |
- "test/**" | |
- "package.json" | |
- ".github/workflows/tester.yml" | |
pull_request: | |
paths: | |
- "lib/**" | |
- "test/**" | |
- "package.json" | |
- ".github/workflows/tester.yml" | |
env: | |
CI: true | |
jobs: | |
tester: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
node-version: [14, 16, 18] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install pandoc | |
env: | |
runner_os: ${{runner.os}} | |
run: node .github/workflows/install-pandoc.js | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- uses: actions/cache@v3 | |
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies | |
run: npm i | |
- name: Test | |
run: npm run test | |
coverage: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
node-version: ["lts/*"] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install pandoc | |
env: | |
runner_os: ${{runner.os}} | |
run: node .github/workflows/install-pandoc.js | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
shell: bash | |
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | |
- uses: actions/cache@v3 | |
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies | |
run: npm i | |
- name: Test | |
run: npm run test-cov | |
- uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.github_token }} |