Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5ab00d5
Move codegen API to separate Elm package
adamdicarlo0 Jun 23, 2025
03a1662
Replace elm-placeholder-pkg with (to-be) real package
adamdicarlo0 Jun 23, 2025
f9e38db
Flesh out example project, add scripts & docs, clean up
adamdicarlo0 Jun 23, 2025
9d31e67
Clean up and simplify
adamdicarlo0 Jun 23, 2025
d103146
Minor CONTRIBUTING fixes
adamdicarlo0 Jun 23, 2025
ac42431
Add gnused dependency to avoid dev script havoc on macOS
adamdicarlo0 Jun 23, 2025
021d6f1
Add safety/better error message if wrong sed is present
adamdicarlo0 Jun 23, 2025
c452cac
Small doc fix
adamdicarlo0 Jun 23, 2025
af109e0
Add gitignore note
adamdicarlo0 Jun 23, 2025
51e1220
Don't run elm-format on generated elm-codegen code
adamdicarlo0 Jun 23, 2025
cd59d0f
Add findutils to shell.nix
adamdicarlo0 Jun 23, 2025
ead5a0b
Fix a couple things and start adding package docs
adamdicarlo0 Jun 23, 2025
4d02e39
Improve format script
adamdicarlo0 Jun 24, 2025
477c247
Scripts, CI
adamdicarlo0 Jun 24, 2025
1cbfea5
Add package docs, hopefully fix CI
adamdicarlo0 Jun 24, 2025
1a63738
Remove no-longer-needed codegen project, packages, etc.
adamdicarlo0 Jun 24, 2025
a8b469a
Use tools from nix devShell in CI
adamdicarlo0 Jun 24, 2025
efbe082
Dig in deeper / debug
adamdicarlo0 Jun 24, 2025
2eea035
Suppress error for unused placeholder module
adamdicarlo0 Jun 24, 2025
9a716b5
ci: Clean up, add 'build' step (to make sure it works)
adamdicarlo0 Jun 24, 2025
aef5460
Upgrade elm-pages
adamdicarlo0 Jun 24, 2025
e51cab4
Desperation
adamdicarlo0 Jun 24, 2025
0d53db2
Fix cache keys
adamdicarlo0 Jun 24, 2025
45e501f
Desperation
adamdicarlo0 Jun 24, 2025
b5e8111
Fix example-using-api in CI
adamdicarlo0 Jun 24, 2025
ded0297
Fix TestGenScript
adamdicarlo0 Jun 24, 2025
e80b96a
ci: Fix nix store caching
adamdicarlo0 Jun 24, 2025
5b07230
Clean up, add back elm-codegen for package folder script
adamdicarlo0 Jun 25, 2025
4764546
Fix readme typo
adamdicarlo0 Jun 25, 2025
9bb0776
Remove the sync-elm-codegen hack
adamdicarlo0 Jun 25, 2025
fa349f8
elm-open-api-codegen: Auto-remove unused Gen modules in codegen script
adamdicarlo0 Jul 1, 2025
1d4cdb2
Resolve security vulnerabilities in dependencies
adamdicarlo0 Jul 3, 2025
0dad6d0
Simplify example-using-api, improve new READMEs
adamdicarlo0 Jul 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
143 changes: 120 additions & 23 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20

- uses: DeterminateSystems/determinate-nix-action@v3

# Re-use node_modules between runs until package-lock.json changes.
- name: Cache node_modules
Expand All @@ -26,39 +24,109 @@ jobs:
key: node_modules-${{ hashFiles('package-lock.json') }}

# Re-use ~/.elm between runs until elm.json or review/elm.json changes.
# The Elm compiler saves downloaded Elm packages to ~/.elm saves
# downloaded tool executables there.
# The Elm compiler saves downloaded Elm packages to ~/.elm
- name: Cache ~/.elm
uses: actions/cache@v4
with:
path: ~/.elm
key: elm-${{ hashFiles('elm.json', 'review/elm.json') }}
key: |
elm-${{ hashFiles(
'elm.json',
'review/elm.json',
'elm-open-api-codegen/elm.json',
'elm-open-api-codegen/review/elm.json'
)}}

# Caching based on https://github.com/jetify-com/devbox-install-action/blob/main/action.yml
- name: Workaround nix store cache permission issue
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
gtar_path=$(which gtar)
sudo mv $gtar_path $gtar_path.orig
echo "#!/bin/sh" >> $gtar_path
echo "exec sudo $gtar_path.orig \"\$@\"" >> $gtar_path
sudo chmod +x $gtar_path
elif [ "$RUNNER_OS" == "Linux" ]; then
mkdir -p ~/.cache
mkdir -p ~/.local/bin
echo "#!/bin/sh" >> ~/.local/bin/tar
echo 'exec sudo /usr/bin/tar "$@"' >> ~/.local/bin/tar
sudo chmod +x ~/.local/bin/tar
fi
- name: Mount nix store cache
id: cache-nix-store
uses: actions/cache/restore@v4
with:
path: |
~/.cache/devbox
~/.cache/nix
~/.local/state/nix
~/.nix-defexpr
~/.nix-profile
/nix/store
/nix/var/nix
key: nix-store-${{ hashFiles('shell.nix', 'flake.lock') }}

- name: Build devShell to populate Nix store
run: nix develop -c echo devShell built

- name: Save nix store cache
if: steps.cache-nix-store.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
~/.cache/nix
~/.local/state/nix
~/.nix-defexpr
~/.nix-profile
/nix/store
/nix/var/nix
key: nix-store-${{ hashFiles('shell.nix', 'flake.lock') }}
- name: Restore tar command
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
gtar_path=$(which gtar)
sudo mv $gtar_path.orig $gtar_path
elif [ "$RUNNER_OS" == "Linux" ]; then
rm ~/.local/bin/tar
fi
# END of Nix store caching

# Install npm packages, unless we restored them from cache.
# Since `npm ci` removes the node_modules folder before running it’s
# important to skip this step if cache was restored.
- name: npm ci
if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci
run: nix develop --command npm ci

# TEMPORARY UNTIL elm-open-api-codegen IS PUBLISHED
- name: TEMP HACK
run: nix develop --command npm run link-local-package

- name: Format
run: npm run format
run: nix develop --command npm run format

- name: Review
run: npm run review
run: nix develop --command npm run review

- name: Test
run: npm run test
run: nix develop --command npm run test

- name: Build
run: nix develop --command npm run build

# TEMPORARY UNTIL elm-open-api-codegen IS PUBLISHED
- name: TEMP HACK
run: nix develop --command npm run unlink-local-package

diff-generation:
permissions:
checks: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20

- name: Checkout branch
uses: actions/checkout@v4
with:
Expand All @@ -70,6 +138,16 @@ jobs:
ref: main
path: main

- uses: DeterminateSystems/determinate-nix-action@v3

- name: Build devShell (branch)
run: nix develop -c echo devShell built
working-directory: branch

- name: Build devShell (main)
run: nix develop -c echo devShell built
working-directory: main

# Re-use node_modules between runs until package-lock.json changes.
- name: Cache node_modules (branch)
id: cache-node_modules-branch
Expand All @@ -87,37 +165,56 @@ jobs:
key: node_modules-${{ hashFiles('main/package-lock.json') }}

# Re-use ~/.elm between runs until elm.json or review/elm.json changes.
# The Elm compiler saves downloaded Elm packages to ~/.elm saves
# downloaded tool executables there.
# The Elm compiler saves downloaded Elm packages to ~/.elm.
- name: Cache ~/.elm (both)
uses: actions/cache@v4
with:
path: ~/.elm
key: elm-${{ hashFiles('main/elm.json', 'main/review/elm.json', 'branch/elm.json', 'branch/review/elm.json') }}
key: |
elm-${{ hashFiles(
'main/elm.json',
'main/review/elm.json',
'main/elm-open-api-codegen/elm.json',
'main/elm-open-api-codegen/review/elm.json',
'branch/elm.json',
'branch/review/elm.json',
'branch/elm-open-api-codegen/elm.json',
'branch/elm-open-api-codegen/review/elm.json'
)}}

# Install npm packages, unless we restored them from cache.
# Since `npm ci` removes the node_modules folder before running it’s
# important to skip this step if cache was restored.
- name: npm ci (branch)
if: steps.cache-node_modules-branch.outputs.cache-hit != 'true'
working-directory: branch
run: npm ci
run: nix develop --command npm ci

# Install npm packages, unless we restored them from cache.
# Since `npm ci` removes the node_modules folder before running it’s
# important to skip this step if cache was restored.
- name: npm ci (main)
if: steps.cache-node_modules-main.outputs.cache-hit != 'true'
working-directory: main
run: npm ci
run: nix develop --command npm ci

# TEMPORARY UNTIL elm-open-api-codegen IS PUBLISHED
- name: TEMP HACK
run: nix develop --command npm run link-local-package
working-directory: branch

- name: Generate (branch)
working-directory: branch
run: npm run test:gen
run: nix develop --command npm run test:gen

- name: Generate (main)
working-directory: main
run: npm run test:gen || true # We don't want to block on main failing to generate
run: nix develop --command npm run test:gen || true # We don't want to block on main failing to generate

# TEMPORARY UNTIL elm-open-api-codegen IS PUBLISHED
- name: TEMP HACK
run: nix develop --command npm run unlink-local-package
working-directory: branch

- name: Diff the outputs
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Elm
.elm-pages
elm-stuff

# JavaScript
Expand Down
Loading