Skip to content

Enhance subscription time calculation #3507

Enhance subscription time calculation

Enhance subscription time calculation #3507

Workflow file for this run

# This workflow builds the project and executes all tests on the main branch or PRs.
name: Build and test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
merge_group:
# Cancel previous PR/branch runs when a new commit is pushed
concurrency:
group: ${{ github.ref }}-build-tests
cancel-in-progress: true
jobs:
check-and-lint:
outputs:
package-changes: ${{ steps.changes.outputs.src }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- "package.json"
- "packages/**/package.json"
- ".github/workflows/build-test.js.yml"
- name: Prepare testing environment
uses: ./.github/actions/prepare-env
- run: npm run format-verify
- run: npm run lint
build-non-linux:
needs: [ check-and-lint ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [ 18.x, 20.x, 22.x ]
os: [ macos-latest, windows-2019 ]
steps:
- uses: actions/checkout@v4
if: ${{ needs.check-and-lint.outputs.package-changes == 'true' }}
- uses: actions/setup-python@v5
if: ${{ needs.check-and-lint.outputs.package-changes == 'true' }}
# needed as long as we test Node.js 16 and npm <10.2.2 is used for Node.js 18/20
with:
python-version: '3.11'
- name: Build on ${{ matrix.os }}
if: ${{ needs.check-and-lint.outputs.package-changes == 'true' }}
uses: ./.github/actions/prepare-env
with:
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
test:
needs: [ check-and-lint ]
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x, 20.x, 22.x ]
steps:
- uses: actions/checkout@v4
- name: Prepare testing environment
uses: ./.github/actions/prepare-env
with:
node-version: ${{ matrix.node-version }}
- name: Prepare Webbrowser testing environment
uses: ./.github/actions/prepare-webtests
- name: Execute tests
run: npm run test