From 1be245842154d2abbe181b31c63ab69530e7c664 Mon Sep 17 00:00:00 2001 From: Claudia Meadows Date: Mon, 2 Sep 2024 08:50:58 -0700 Subject: [PATCH] Simplify CI workflow, strip vestiges of Travis --- .github/workflows/ci.yml | 120 +++++---------------------------------- README v5 preview.md | 6 +- README.md | 6 +- 3 files changed, 20 insertions(+), 112 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa913f3..e91224b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,121 +3,29 @@ name: CI on: [push, pull_request] jobs: - test-cli: + test: runs-on: ${{ matrix.os }} - name: CLI Tests, node v${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }} with ${{ matrix.shell }} + name: ${{ matrix.task }}, node v${{ matrix.node_version }} on ${{ matrix.os }} strategy: matrix: + task: + - test-cli + - test-api os: - - ubuntu-latest - - macos-latest - - windows-latest + - ubuntu-latest + - macos-latest + - windows-latest + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ node_version: - - 14 - - 16 - - 18 - architecture: - - x64 - shell : - - bash - include: - - os: windows-latest - shell: cmd - node_version: 14 - - os: windows-latest - shell: powershell - node_version: 14 - - os: windows-latest - shell: pwsh - node_version: 14 - - os: windows-latest - shell: cmd - node_version: 16 - - os: windows-latest - shell: powershell - node_version: 16 - - os: windows-latest - shell: pwsh - node_version: 16 - - os: windows-latest - shell: cmd - node_version: 18 - - os: windows-latest - shell: powershell - node_version: 18 - - os: windows-latest - shell: pwsh - node_version: 18 + - 16 + - 18 + - 20 + - 22 steps: - # https://github.com/actions/checkout#Push-a-commit-using-the-built-in-token - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node_version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node_version }} - - - name: Get npm cache directory - id: npm-cache-dir - shell: bash - run: | - echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v3 - with: - path: ${{ steps.npm-cache-dir.outputs.dir }} - key: 'node-v${{ matrix.node_version }}--arch-${{ matrix.architecture }}--${{ matrix.os }}--${{ matrix.shell }}--${{ - hashFiles(''**/package-lock.json'') - }}' - restore-keys: 'node-v${{ matrix.node_version }}--arch-${{ matrix.architecture }}--${{ matrix.os }}--${{ matrix.shell }}--' - - - run: npm ci - - run: corepack enable - - run: npm run test-cli - - - test-api: - runs-on: ${{ matrix.os }} - name: API tests, node v${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }} - strategy: - matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - node_version: - - 14 - architecture: - - x64 - include: - - os: ubuntu-latest - node_version: 16 - - os: ubuntu-latest - node_version: 18 - - steps: - # https://github.com/actions/checkout#Push-a-commit-using-the-built-in-token - - uses: actions/checkout@v3 - - - name: Use Node.js v${{ matrix.node_version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node_version }} - - - name: Get npm cache directory - id: npm-cache-dir - shell: bash - run: | - echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT - - - uses: actions/cache@v3 - with: - path: ${{ steps.npm-cache-dir.outputs.dir }} - key: 'node-v${{ matrix.node_version }}--arch-${{ matrix.architecture }}--${{ matrix.os }}--default-shell--${{ - hashFiles(''**/package-lock.json'') - }}' - restore-keys: 'node-v${{ matrix.node_version }}--arch-${{ matrix.architecture }}--${{ matrix.os }}--default-shell--' - - run: npm ci - - run: corepack enable - - run: npm run test-api + - run: npm run ${{ matrix.task }} diff --git a/README v5 preview.md b/README v5 preview.md index 2c62e8d..e7c6afa 100644 --- a/README v5 preview.md +++ b/README v5 preview.md @@ -1,8 +1,8 @@ # ospec -[![npm License](https://img.shields.io/npm/l/ospec.svg)](https://www.npmjs.com/package/ospec) [![npm Version](https://img.shields.io/npm/v/ospec.svg)](https://www.npmjs.com/package/ospec) [![Build Status](https://img.shields.io/travis/MithrilJS/ospec/master.svg)](https://travis-ci.org/MithrilJS/ospec) [![npm Downloads](https://img.shields.io/npm/dm/ospec.svg)](https://www.npmjs.com/package/ospec) +[![npm License](https://img.shields.io/npm/l/ospec.svg)](https://www.npmjs.com/package/ospec) [![npm Version](https://img.shields.io/npm/v/ospec.svg)](https://www.npmjs.com/package/ospec) ![Build Status](https://img.shields.io/github/actions/workflow/status/MithrilJS/ospec/.github%2Fworkflows%2Fci.yml) [![npm Downloads](https://img.shields.io/npm/dm/ospec.svg)](https://www.npmjs.com/package/ospec) -[![Donate at OpenCollective](https://img.shields.io/opencollective/all/mithriljs.svg?colorB=brightgreen)](https://opencollective.com/mithriljs) [![Gitter](https://img.shields.io/gitter/room/mithriljs/mithril.js.svg)](https://gitter.im/mithriljs/mithril.js) +[![Donate at OpenCollective](https://img.shields.io/opencollective/all/mithriljs.svg?colorB=brightgreen)](https://opencollective.com/mithriljs) [![Zulip, join chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://mithril.zulipchat.com/) --- @@ -742,7 +742,7 @@ While some testing libraries consider error thrown as assertions failure, `ospec - An error thrown in a task... - ...prevents further streaks and nested specs in the current spec from running. The `after` *hook* of the spec will run. - ...if thrown in a `beforeEach` hook of a streak, causes the streak to be hollowed out. Hooks defined in nested scopes and the actual test will not run. However, the `afterEach` hook corresponding to the one that crashed will run, as will those defined in outer scopes. - + For every error thrown, a "bail out" failure is reported. --- diff --git a/README.md b/README.md index 3aba52b..22b836b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # ospec -[![npm License](https://img.shields.io/npm/l/ospec.svg)](https://www.npmjs.com/package/ospec) [![npm Version](https://img.shields.io/npm/v/ospec.svg)](https://www.npmjs.com/package/ospec) [![Build Status](https://img.shields.io/travis/MithrilJS/ospec/master.svg)](https://travis-ci.org/MithrilJS/ospec) [![npm Downloads](https://img.shields.io/npm/dm/ospec.svg)](https://www.npmjs.com/package/ospec) +[![npm License](https://img.shields.io/npm/l/ospec.svg)](https://www.npmjs.com/package/ospec) [![npm Version](https://img.shields.io/npm/v/ospec.svg)](https://www.npmjs.com/package/ospec) ![Build Status](https://img.shields.io/github/actions/workflow/status/MithrilJS/ospec/.github%2Fworkflows%2Fci.yml) [![npm Downloads](https://img.shields.io/npm/dm/ospec.svg)](https://www.npmjs.com/package/ospec) -[![Donate at OpenCollective](https://img.shields.io/opencollective/all/mithriljs.svg?colorB=brightgreen)](https://opencollective.com/mithriljs) [![Gitter](https://img.shields.io/gitter/room/mithriljs/mithril.js.svg)](https://gitter.im/mithriljs/mithril.js) +[![Donate at OpenCollective](https://img.shields.io/opencollective/all/mithriljs.svg?colorB=brightgreen)](https://opencollective.com/mithriljs) [![Zulip, join chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://mithril.zulipchat.com/) --- @@ -711,7 +711,7 @@ While some testing libraries consider error thrown as assertions failure, `ospec - An error thrown in a task... - ...prevents further streaks and nested specs in the current spec from running. The `after` *hook* of the spec will run. - ...if thrown in a `beforeEach` hook of a streak, causes the streak to be hollowed out. Hooks defined in nested scopes and the actual test will not run. However, the `afterEach` hook corresponding to the one that crashed will run, as will those defined in outer scopes. - + For every error thrown, a "bail out" failure is reported. ---