Skip to content

Commit

Permalink
Update ci config
Browse files Browse the repository at this point in the history
  • Loading branch information
ndaidong committed Jun 22, 2024
1 parent 4898259 commit 8d1c605
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 44 deletions.
52 changes: 13 additions & 39 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,18 @@ jobs:

strategy:
matrix:
node_version: [18.x, 20.x, 21.x]
deno-version: [1.44.4]

steps:
- uses: actions/checkout@v4

- name: setup Node.js v${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}

- name: run npm scripts
run: |
npm install
npm run lint
npm run test
- name: Coveralls Parallel
uses: coverallsapp/github-action@v2
with:
flag-name: run-${{ join(matrix.*, '-') }}
parallel: true
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: cache node modules
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
finish:
needs: test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: "run-18.x,run-20.x,run-21.x"
- name: Git Checkout Deno Module
uses: actions/checkout@v2
- name: Use Deno Version ${{ matrix.deno-version }}
uses: denolib/setup-deno@v2
with:
deno-version: ${{ matrix.deno-version }}
- name: Lint Deno Module
run: deno fmt --check
- name: Build Deno Module
run: deno run --reload mod.ts
- name: Test Deno Module
run: deno test --allow-none
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ English. Inspired by [Sentencer](https://github.com/kylestetz/Sentencer) and

[![NPM](https://badge.fury.io/js/txtgen.svg)](https://badge.fury.io/js/txtgen)
[![CI test](https://github.com/ndaidong/txtgen/workflows/ci-test/badge.svg)](https://github.com/ndaidong/txtgen/actions)
[![Coverage Status](https://coveralls.io/repos/github/ndaidong/txtgen/badge.svg)](https://coveralls.io/github/ndaidong/txtgen)
![CodeQL](https://github.com/ndaidong/txtgen/workflows/CodeQL/badge.svg)

# Demo
Expand Down
1 change: 1 addition & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"build": "deno run -A ./scripts/build_npm.ts"
},
"imports": {
"assert": "https://deno.land/[email protected]/assert/mod.ts",
"@deno/dnt": "jsr:@deno/dnt@^0.41.2"
},
"test": {
Expand Down
1 change: 1 addition & 0 deletions scripts/build_npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const outputDir = "./npm";
await emptyDir(outputDir);

await build({
importMap: "deno.json",
entryPoints: ["./mod.ts"],
outDir: outputDir,
shims: {
Expand Down
5 changes: 1 addition & 4 deletions tests/mod_test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
assertEquals,
assertGreaterOrEqual,
} from "https://deno.land/[email protected]/assert/mod.ts";
import { assertEquals, assertGreaterOrEqual } from "assert";

import { article, lorem, paragraph, sentence } from "../mod.ts";

Expand Down

0 comments on commit 8d1c605

Please sign in to comment.