Skip to content

Commit 6b59f4e

Browse files
🤖 test: Allow to test build with AVA.
These changes were automatically generated by a transform whose code can be found at: - https://github.com/make-github-pseudonymous-again/rejuvenate/blob/a40f4dd29587f2c7f4c7821b7263b79996434a5e/src/transforms/ava:test-build.js Please contact the author of the transform if you believe there was an error.
1 parent f174b5e commit 6b59f4e

22 files changed

+147
-27
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: ci
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
jobs:
8+
9+
build:
10+
name: Continuous integration (build)
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout 🛎️
14+
uses: actions/checkout@v4
15+
16+
- name: Install 📦
17+
uses: bahmutov/npm-install@v1
18+
with:
19+
install-command: yarn --frozen-lockfile --ignore-scripts
20+
useRollingCache: true
21+
22+
- name: Build 🏗️
23+
run: yarn build
24+
25+
- name: Archive build 💽
26+
uses: actions/upload-artifact@v3
27+
with:
28+
name: dist
29+
path: dist
30+
retention-days: 1
31+
32+
test:
33+
needs: ["build"]
34+
name: Continuous integration (tests)
35+
runs-on: ubuntu-latest
36+
strategy:
37+
matrix:
38+
bundle: ["modern", "module", "cjs"]
39+
steps:
40+
- name: Checkout 🛎️
41+
uses: actions/checkout@v4
42+
43+
- name: Install 📦
44+
uses: bahmutov/npm-install@v1
45+
with:
46+
install-command: yarn --frozen-lockfile --ignore-scripts
47+
useRollingCache: true
48+
49+
- name: Load build 💽
50+
uses: actions/download-artifact@v3
51+
with:
52+
name: dist
53+
path: dist
54+
55+
- name: Test 🔬
56+
run: yarn test:${{ matrix.bundle }}

.github/workflows/ci:test.yml renamed to .github/workflows/ci:cover.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
name: ci:test
1+
name: ci:cover
22
on:
33
- push
44
- pull_request
55
jobs:
6-
test:
7-
name: Continuous integration (tests)
6+
cover:
7+
name: Continuous integration (code coverage)
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout 🛎️
1111
uses: actions/checkout@v4
1212

13-
- name: Install 🔧
13+
- name: Install 📦
1414
uses: bahmutov/npm-install@v1
1515
with:
1616
install-command: yarn --frozen-lockfile --ignore-scripts
1717
useRollingCache: true
1818

19-
- name: Test 🔬
20-
run: yarn ci:test
19+
- name: Test and record coverage 🔬
20+
run: yarn cover
2121

2222
- name: Publish coverage report 📃
2323
uses: codecov/codecov-action@v3

.github/workflows/ci:lint-config.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: ci:lint-config
2+
on:
3+
- push
4+
- pull_request
5+
jobs:
6+
cover:
7+
name: Continuous integration (config linting)
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout 🛎️
11+
uses: actions/checkout@v4
12+
13+
- name: Install 📦
14+
uses: bahmutov/npm-install@v1
15+
with:
16+
install-command: yarn --frozen-lockfile --ignore-scripts
17+
useRollingCache: true
18+
19+
- name: Lint config 👕
20+
run: yarn lint-config
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
name: ci:build
1+
name: ci:lint
22
on:
33
- push
44
- pull_request
55
jobs:
6-
test:
7-
name: Continuous integration (build)
6+
cover:
7+
name: Continuous integration (code linting)
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout 🛎️
1111
uses: actions/checkout@v4
1212

13-
- name: Install 🔧
13+
- name: Install 📦
1414
uses: bahmutov/npm-install@v1
1515
with:
1616
install-command: yarn --frozen-lockfile --ignore-scripts
1717
useRollingCache: true
1818

19-
- name: Build 🏗️
20-
run: yarn ci:build
19+
- name: Lint 👕
20+
run: yarn lint

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ implication( negation( lt( 7 ) ) , gt( 5 ) )( ... ) ; // true
1111

1212
[![License](https://img.shields.io/github/license/functional-abstraction/predicate.svg)](https://raw.githubusercontent.com/functional-abstraction/predicate/main/LICENSE)
1313
[![Version](https://img.shields.io/npm/v/@functional-abstraction/predicate.svg)](https://www.npmjs.org/package/@functional-abstraction/predicate)
14-
[![Tests](https://img.shields.io/github/workflow/status/functional-abstraction/predicate/ci:test?event=push&label=tests)](https://github.com/functional-abstraction/predicate/actions/workflows/ci:test.yml?query=branch:main)
14+
[![Tests](https://img.shields.io/github/workflow/status/functional-abstraction/predicate/ci?event=push&label=tests)](https://github.com/functional-abstraction/predicate/actions/workflows/ci.yml?query=branch:main)
1515
[![Dependencies](https://img.shields.io/librariesio/github/functional-abstraction/predicate.svg)](https://github.com/functional-abstraction/predicate/network/dependencies)
1616
[![GitHub issues](https://img.shields.io/github/issues/functional-abstraction/predicate.svg)](https://github.com/functional-abstraction/predicate/issues)
1717
[![Downloads](https://img.shields.io/npm/dm/@functional-abstraction/predicate.svg)](https://www.npmjs.org/package/@functional-abstraction/predicate)

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454
"build": "NODE_ENV=production microbundle",
5555
"build-docs": "esdoc",
5656
"build-gh-pages": "npm run build-docs",
57-
"ci:build": "npm run build",
58-
"ci:test": "npm run lint-config && npm run lint && npm run cover",
5957
"commit-msg": "commitlint --edit",
6058
"cover": "NODE_ENV=cover c8 --all --src src --reporter lcov --reporter text-summary --reporter text npm test",
6159
"debug": "NODE_ENV=debug npm run test -- -st --fail-fast",
@@ -71,7 +69,13 @@
7169
"prepare": "npm run build",
7270
"prepublishOnly": "pinst --disable",
7371
"release": "np --message ':hatching_chick: release: Bumping to v%s.'",
74-
"test": "ava"
72+
"test": "npm run test:src",
73+
"test-cmd": "NODE_LOADER_CONFIG=test/loader/config.js ava",
74+
"test:cjs": "IMPORT_MAP_PATH=test/import-maps/dist/index.json npm run test-cmd",
75+
"test:dist": "npm run test:modern && npm run test:module && npm run test:cjs",
76+
"test:modern": "IMPORT_MAP_PATH=test/import-maps/dist/index.modern.json npm run test-cmd",
77+
"test:module": "IMPORT_MAP_PATH=test/import-maps/dist/index.module.json npm run test-cmd",
78+
"test:src": "IMPORT_MAP_PATH=test/import-maps/src/index.json npm run test-cmd"
7579
},
7680
"dependencies": {},
7781
"devDependencies": {
@@ -80,6 +84,8 @@
8084
"@commitlint/cli": "18.6.0",
8185
"@js-library/commitlint-config": "0.0.4",
8286
"@node-loader/babel": "2.0.1",
87+
"@node-loader/core": "2.0.0",
88+
"@node-loader/import-maps": "1.1.0",
8389
"ava": "6.1.1",
8490
"babel-plugin-transform-remove-console": "6.9.4",
8591
"babel-plugin-unassert": "3.2.0",
@@ -103,7 +109,7 @@
103109
"test/src/**/*"
104110
],
105111
"nodeArguments": [
106-
"--experimental-loader=@node-loader/babel"
112+
"--experimental-loader=@node-loader/core"
107113
],
108114
"require": [
109115
"regenerator-runtime/runtime.js"

test/import-maps/dist/index.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"imports": {
3+
"#module": "./dist/index.cjs"
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"imports": {
3+
"#module": "./dist/index.modern.js"
4+
}
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"imports": {
3+
"#module": "./dist/index.module.js"
4+
}
5+
}

test/import-maps/src/index.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"imports": {
3+
"#module": "./src/index.js"
4+
}
5+
}

0 commit comments

Comments
 (0)