Skip to content

Commit

Permalink
Simplify CI workflow, strip vestiges of Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
dead-claudia committed Sep 2, 2024
1 parent 31d105b commit 1be2458
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 112 deletions.
120 changes: 14 additions & 106 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
6 changes: 3 additions & 3 deletions README v5 preview.md
Original file line number Diff line number Diff line change
@@ -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/)

---

Expand Down Expand Up @@ -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.

---
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/)

---

Expand Down Expand Up @@ -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.

---
Expand Down

0 comments on commit 1be2458

Please sign in to comment.