Skip to content

Update Dependencies #572

Update Dependencies

Update Dependencies #572

Workflow file for this run

name: CI
on: pull_request
env:
FORCE_COLOR: 3
permissions:
contents: read
jobs:
lint:
name: Lint
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: Brightspace/third-party-actions@actions/checkout
- name: Set up node
uses: Brightspace/third-party-actions@actions/setup-node
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm ci
- name: Lint (ESLint)
run: npm run lint:eslint
- name: Lint (EditorConfig)
run: npm run lint:editorconfig
licenses:
name: Check Licenses
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: Brightspace/third-party-actions@actions/checkout
- name: Set up node
uses: Brightspace/third-party-actions@actions/setup-node
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: npm ci
- name: Check licenses
run: npm run license-check
test:
name: Test
timeout-minutes: 15
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: Brightspace/third-party-actions@actions/checkout
- name: Set up node
uses: Brightspace/third-party-actions@actions/setup-node
with:
node-version-file: .nvmrc
cache: npm
- name: Install dependencies
run: |
npm ci
npx playwright install --with-deps
- name: Run tests
run: npm run test:all
- name: Upload coverage report
id: coverage-report
uses: actions/upload-artifact@main
with:
name: coverage-report
path: coverage/lcov-report/
- name: Generate test summary
id: test-summary
uses: Brightspace/third-party-actions@actions/github-script
with:
script: |
const { env } = await import('node:process');
const { COVERAGE_REPORT_URL: coverageReportUrl } = env;
const { summary } = core;
summary.clear();
summary.addHeading('Coverage report', 3);
summary.addLink('Report', coverageReportUrl);
summary.addHeading('Generated reports', 3);
const reporters = [{
name: 'mocha',
path: './d2l-test-report-mocha.json'
}, {
name: 'playwright',
path: './d2l-test-report-playwright.json'
}, {
name: '@web/test-runner',
path: './d2l-test-report-web-test-runner.json'
}];
for (const { name, path } of reporters) {
let report = require(path);
report = JSON.stringify(report, null, 2);
report = `\n\n\`\`\`json\n${report}\n\`\`\`\n\n`;
summary.addDetails(name, report);
}
summary.write({ overwrite: true });
core.setOutput('report', summary.stringify());
env:
COVERAGE_REPORT_URL: ${{steps.coverage-report.outputs.artifact-url}}
- name: Leave comment
uses: BrightspaceUI/actions/comment-on-pr@main
with:
message: ${{steps.test-summary.outputs.report}}
post-mode: hide-previous