Skip to content

Commit ff29927

Browse files
authored
Merge pull request #201 from takker99:ci
ci: use `@molt/action` and `deno test --doc`
2 parents 96d896c + 0c217e3 commit ff29927

File tree

4 files changed

+19
-44
lines changed

4 files changed

+19
-44
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ jobs:
1414
with:
1515
deno-version: ${{ env.DENO_VERSION }}
1616
- name: Check fmt & lint & type check & test
17-
run: deno task check:dry
17+
run: deno task check

.github/workflows/publish.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,19 @@ env:
77
on:
88
push:
99
tags:
10-
- '*'
10+
- "*"
1111

1212
permissions:
1313
contents: read
14-
id-token: write # The OIDC ID token is used for authentication with JSR.
15-
14+
id-token: write
1615

1716
jobs:
1817
publish:
1918
runs-on: ubuntu-latest
2019
steps:
2120
- uses: actions/checkout@v4
22-
- name: Install Deno
23-
uses: denoland/setup-deno@v1
21+
- uses: denoland/setup-deno@v1
2422
with:
2523
deno-version: ${{ env.DENO_VERSION }}
2624
- name: Publish on tag
27-
run: deno task publish
25+
run: deno run --allow-env --allow-run=deno --allow-read --allow-write=deno.jsonc jsr:@david/publish[email protected]

.github/workflows/udd.yml

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,19 @@
1-
# ported from https://github.com/jsr-core/unknownutil/blob/v3.18.1/.github/workflows/udd.yml and modified a bit
2-
name: Update
3-
4-
env:
5-
DENO_VERSION: 1.x
1+
name: update
62

73
on:
84
schedule:
95
- cron: "0 0 * * *"
106
workflow_dispatch:
117

8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
1212
jobs:
13-
udd:
13+
update:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17-
- uses: denoland/setup-deno@v1
18-
with:
19-
deno-version: ${{ env.DENO_VERSION }}
20-
- name: Update dependencies
21-
run: |
22-
deno task update > ../output.txt
23-
env:
24-
NO_COLOR: 1
25-
- name: Read ../output.txt
26-
id: log
27-
uses: juliangruber/read-file-action@v1
17+
- uses: hasundue/molt-action@v1
2818
with:
29-
path: ../output.txt
30-
- uses: peter-evans/create-pull-request@v6
31-
with:
32-
commit-message: ":package: Update Deno dependencies"
33-
title: ":package: Update Deno dependencies"
34-
body: |
35-
The output of `deno task update` is
36-
37-
```
38-
${{ steps.log.outputs.content }}
39-
```
40-
branch: update-deno-dependencies
41-
author: GitHub <[email protected]>
42-
delete-branch: true
19+
commit-prefix: ":package:"

deno.jsonc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"name": "@cosense/std",
33
"version": "0.0.0",
44
"tasks": {
5-
"check": "deno fmt && deno lint --fix && deno check --remote **/*.ts && deno test --allow-read",
6-
"check:dry": "deno fmt --check && deno lint && deno check --remote **/*.ts && deno test --allow-read",
7-
"update:check": "deno run --allow-env --allow-read --allow-write=.,'~/.local/share/deno-wasmbuild' --allow-run=git,deno --allow-net=deno.land,raw.githubusercontent.com,esm.sh,jsr.io,api.jsr.io,registry.npmjs.org jsr:@molt/[email protected]",
8-
"update": "deno task update:check --write",
9-
"publish:check": "deno task check:dry && deno publish --dry-run --allow-dirty",
10-
"publish": "deno run --allow-env --allow-run=deno --allow-read --allow-write=deno.jsonc jsr:@david/[email protected]"
5+
"fix": "deno fmt && deno lint --fix && deno test --allow-read --doc --parallel --shuffle && deno publish --dry-run --allow-dirty",
6+
"check": "deno fmt --check && deno lint && deno test --allow-read --doc --parallel --shuffle && deno publish --dry-run",
7+
"coverage": "deno test --allow-read=./ --parallel --shuffle --coverage && deno coverage --html",
8+
// from https://github.com/jsr-core/unknownutil/blob/v4.2.2/deno.jsonc#L84-L85
9+
"update": "deno run --allow-env --allow-read --allow-write=. --allow-run=git,deno --allow-net=jsr.io,registry.npmjs.org jsr:@molt/cli",
10+
"update:commit": "deno task -q update --commit --prefix deps: --pre-commit=fix"
1111
},
1212
"imports": {
1313
"@core/unknownutil": "jsr:@core/unknownutil@^4.0.0",

0 commit comments

Comments
 (0)