Skip to content

Commit dce70e5

Browse files
committed
chore: Align package setup, update tests, and resolve elm-review issues
1 parent e234665 commit dce70e5

18 files changed

Lines changed: 2954 additions & 246 deletions

File tree

.gitattributes

Lines changed: 231 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,231 @@
1+
# Details per file setting:
2+
# text These files should be normalized (i.e. convert CRLF to LF).
3+
# binary These files are binary and should be left untouched.
4+
#
5+
# Note that binary is a macro for -text -diff.
6+
######################################################################
7+
8+
# Auto detect
9+
## Handle line endings automatically for files detected as
10+
## text and leave all files detected as binary untouched.
11+
## This will handle all files NOT defined below.
12+
* text=auto
13+
14+
# Source code
15+
*.bash text eol=lf
16+
*.bat text eol=crlf
17+
*.cmd text eol=crlf
18+
*.coffee text
19+
*.css text diff=css
20+
*.htm text diff=html
21+
*.html text diff=html
22+
*.inc text
23+
*.ini text
24+
*.js text
25+
*.json text
26+
*.jsx text
27+
*.less text
28+
*.ls text
29+
*.map text -diff
30+
*.od text
31+
*.onlydata text
32+
*.php text diff=php
33+
*.pl text
34+
*.ps1 text eol=crlf
35+
*.py text diff=python
36+
*.rb text diff=ruby
37+
*.sass text
38+
*.scm text
39+
*.scss text diff=css
40+
*.sh text eol=lf
41+
*.sql text
42+
*.styl text
43+
*.tag text
44+
*.ts text
45+
*.tsx text
46+
*.xml text
47+
*.xhtml text diff=html
48+
49+
# C# / F#
50+
*.cs text diff=csharp
51+
*.cshtml text diff=html
52+
*.csx text diff=csharp
53+
*.sln text eol=crlf merge=union
54+
*.csproj text merge=union
55+
56+
# Rust
57+
*.rs text diff=rust
58+
*.toml text diff=toml
59+
Cargo.lock text
60+
61+
# Python
62+
*.pxd text diff=python
63+
*.py text diff=python
64+
*.py3 text diff=python
65+
*.pyw text diff=python
66+
*.pyx text diff=python
67+
*.pyz text diff=python
68+
*.pyi text diff=python
69+
*.db binary
70+
*.p binary
71+
*.pkl binary
72+
*.pickle binary
73+
*.pyc binary export-ignore
74+
*.pyo binary export-ignore
75+
*.pyd binary
76+
*.ipynb text
77+
78+
# Docker
79+
Dockerfile text
80+
81+
# Documentation
82+
*.ipynb text
83+
*.markdown text diff=markdown
84+
*.md text diff=markdown
85+
*.mdwn text diff=markdown
86+
*.mdown text diff=markdown
87+
*.mkd text diff=markdown
88+
*.mkdn text diff=markdown
89+
*.mdtxt text
90+
*.mdtext text
91+
*.txt text
92+
AUTHORS text
93+
CHANGELOG text
94+
CHANGES text
95+
CONTRIBUTING text
96+
COPYING text
97+
copyright text
98+
*COPYRIGHT* text
99+
INSTALL text
100+
license text
101+
LICENSE text
102+
NEWS text
103+
readme text
104+
*README* text
105+
TODO text
106+
107+
# Templates
108+
*.dot text
109+
*.ejs text
110+
*.erb text
111+
*.haml text
112+
*.handlebars text
113+
*.hbs text
114+
*.hbt text
115+
*.jade text
116+
*.latte text
117+
*.mustache text
118+
*.njk text
119+
*.phtml text
120+
*.svelte text
121+
*.tmpl text
122+
*.tpl text
123+
*.twig text
124+
*.vue text
125+
126+
# Configs
127+
*.cnf text
128+
*.conf text
129+
*.config text
130+
.editorconfig text
131+
.env text
132+
.gitattributes text
133+
.gitconfig text
134+
.htaccess text
135+
*.lock text -diff
136+
package.json text eol=lf
137+
package-lock.json text -diff
138+
pnpm-lock.yaml text eol=lf -diff
139+
.prettierrc text
140+
yarn.lock text -diff
141+
*.toml text
142+
*.yaml text
143+
*.yml text
144+
browserslist text
145+
Makefile text
146+
makefile text
147+
148+
# Heroku
149+
Procfile text
150+
151+
# Graphics
152+
*.ai binary
153+
*.bmp binary
154+
*.eps binary
155+
*.gif binary
156+
*.gifv binary
157+
*.ico binary
158+
*.jng binary
159+
*.jp2 binary
160+
*.jpg binary
161+
*.jpeg binary
162+
*.jpx binary
163+
*.jxr binary
164+
*.pdf binary
165+
*.png binary
166+
*.psb binary
167+
*.psd binary
168+
# SVG treated as an asset (binary) by default.
169+
*.svg text
170+
# If you want to treat it as binary,
171+
# use the following line instead.
172+
# *.svg binary
173+
*.svgz binary
174+
*.tif binary
175+
*.tiff binary
176+
*.wbmp binary
177+
*.webp binary
178+
179+
# Audio
180+
*.kar binary
181+
*.m4a binary
182+
*.mid binary
183+
*.midi binary
184+
*.mp3 binary
185+
*.ogg binary
186+
*.ra binary
187+
188+
# Video
189+
*.3gpp binary
190+
*.3gp binary
191+
*.as binary
192+
*.asf binary
193+
*.asx binary
194+
*.avi binary
195+
*.fla binary
196+
*.flv binary
197+
*.m4v binary
198+
*.mng binary
199+
*.mov binary
200+
*.mp4 binary
201+
*.mpeg binary
202+
*.mpg binary
203+
*.ogv binary
204+
*.swc binary
205+
*.swf binary
206+
*.webm binary
207+
208+
# Archives
209+
*.7z binary
210+
*.gz binary
211+
*.jar binary
212+
*.rar binary
213+
*.tar binary
214+
*.zip binary
215+
216+
# Fonts
217+
*.ttf binary
218+
*.eot binary
219+
*.otf binary
220+
*.woff binary
221+
*.woff2 binary
222+
223+
# Executables
224+
*.exe binary
225+
*.pyc binary
226+
227+
# RC files (like .babelrc or .eslintrc)
228+
*.*rc text
229+
230+
# Ignore files (like .npmignore or .gitignore)
231+
*.*ignore text

.github/actions/lint/action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Lint
2+
3+
description: Run linting
4+
5+
runs:
6+
using: composite
7+
steps:
8+
- uses: pnpm/action-setup@v5
9+
- uses: actions/setup-node@v6
10+
with:
11+
node-version: lts/*
12+
cache: pnpm
13+
- run: pnpm install
14+
shell: bash
15+
- run: pnpm run lint
16+
shell: bash

.github/actions/publish/action.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish
2+
3+
description: Publish to Elm registry and create GitHub release
4+
5+
inputs:
6+
dry-run:
7+
description: Run in dry-run mode
8+
required: true
9+
type: boolean
10+
11+
runs:
12+
using: composite
13+
steps:
14+
- uses: pnpm/action-setup@v5
15+
16+
- uses: actions/setup-node@v6
17+
with:
18+
node-version: lts/*
19+
cache: pnpm
20+
21+
- run: pnpm install
22+
shell: bash
23+
24+
- name: Publish to Elm registry
25+
id: elm-publish
26+
uses: dillonkearns/elm-publish-action@v2
27+
with:
28+
github-token: ${{ inputs.dry-run == false && github.token || '' }}
29+
path-to-elm: ./node_modules/.bin/elm
30+
dry-run: ${{ inputs.dry-run }}
31+
32+
- name: Create GitHub Release
33+
if: inputs.dry-run == false && success()
34+
env:
35+
GH_TOKEN: ${{ github.token }}
36+
run: |
37+
VERSION=$(jq -r '.version' elm.json)
38+
gh release create "$VERSION" --generate-notes
39+
shell: bash

.github/actions/test/action.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Test
2+
3+
description: Run tests
4+
5+
runs:
6+
using: composite
7+
steps:
8+
- uses: pnpm/action-setup@v5
9+
- uses: actions/setup-node@v6
10+
with:
11+
node-version: lts/*
12+
cache: pnpm
13+
- run: pnpm install
14+
shell: bash
15+
- run: pnpm test
16+
shell: bash

.github/workflows/cd.yml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ name: CD
33
on:
44
push:
55
branches: [master]
6+
paths:
7+
- 'src/**'
8+
- 'elm.json'
9+
- 'package.json'
10+
- 'pnpm-lock.yaml'
11+
- 'pnpm-workspace.yaml'
612

713
concurrency:
814
group: ${{ github.workflow }}-${{ github.ref }}
@@ -13,35 +19,22 @@ jobs:
1319
runs-on: ubuntu-latest
1420
steps:
1521
- uses: actions/checkout@v6
16-
- uses: pnpm/action-setup@v5
17-
- uses: actions/setup-node@v6
18-
with:
19-
node-version: lts/*
20-
cache: pnpm
21-
- run: pnpm install
22-
- run: pnpm run lint
22+
- uses: ./.github/actions/lint
23+
24+
test:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v6
28+
- uses: ./.github/actions/test
2329

2430
publish:
31+
needs: [lint, test]
2532
runs-on: ubuntu-latest
26-
needs: lint
2733
permissions:
2834
contents: write
2935
steps:
3036
- uses: actions/checkout@v6
31-
- uses: pnpm/action-setup@v5
32-
- uses: actions/setup-node@v6
33-
with:
34-
node-version: lts/*
35-
cache: pnpm
36-
- run: pnpm install
37-
- uses: dillonkearns/elm-publish-action@v2
37+
38+
- uses: ./.github/actions/publish
3839
with:
39-
github-token: ${{ secrets.GITHUB_TOKEN }}
40-
path-to-elm: ./node_modules/.bin/elm
41-
- name: Get version from elm.json
42-
id: version
43-
run: echo "tag=$(jq -r '.version' elm.json)" >> "$GITHUB_OUTPUT"
44-
- name: Create GitHub Release
45-
env:
46-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47-
run: gh release create "${{ steps.version.outputs.tag }}" --generate-notes
40+
dry-run: false

0 commit comments

Comments
 (0)