Unit tests #7
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: cdm-ci | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on pull request events but only for the master branch | |
# ignore pull requests that only change documentation/license files | |
pull_request: | |
branches: [ master ] | |
paths-ignore: | |
- LICENSE | |
- '**.md' | |
- .github/workflows/faux-crucible-ci.yaml | |
- .github/workflows/faux-cdm-ci.yaml | |
- 'docs/**' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }}/cdm-ci | |
cancel-in-progress: true | |
jobs: | |
# Job to test installation | |
cdm-ci: | |
# Job will run on github-hosted runner | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: enforce javascript style standard | |
run: npx prettier **/*.js --check | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: install html to markdown converter | |
run: pip install html2text | |
- name: check unit tests | |
run: npm test --prefix=queries --coverageDirectory=coverage | |
- name: convert test coverage to markdown | |
run: html2text --ignore-image --ignore-links -b 0 queries/coverage/lcov-report/index.html >> $GITHUB_STEP_SUMMARY | |
- name: upload coverage html artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: queries/coverage | |
if-no-files-found: error |