Skip to content

feat(one-click): implement RFC 8058 one-click unsubscribe #24558

feat(one-click): implement RFC 8058 one-click unsubscribe

feat(one-click): implement RFC 8058 one-click unsubscribe #24558

Workflow file for this run

name: Unit Tests
permissions: {}
on:
pull_request:
push:
schedule:
- cron: '0 8 * * *'
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6
with:
node-version: '20.20.x'
- run: npm ci
- run: npm run build-glean
# Run the regular tests on push
- run: npm test
if: github.event_name != 'schedule'
# But measure coverage without ignore markers in the nighly job
- name: Remove `c8 ignore` markers to output full unit test coverage if on the `report-coverage` branch
run: find src/ -type f -name "*.js" -or -name "*.ts" -or -name "*.jsx" -or -name "*.tsx" -exec sed --in-place --expression='s/c8 ignore/c8 TEMPORARILY DO NOT ignore/g' {} \;
if: github.event_name == 'schedule'
# (and set an arbitrary coverage threshold for that "true" coverage):
- run: npm test -- --coverage.thresholds.lines=80 --coverage.thresholds.functions=80 --coverage.thresholds.branches=80 --coverage.thresholds.statements=80
if: github.event_name == 'schedule'
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
if: always()
with:
name: coverage-report
path: coverage/
retention-days: 30