Skip to content

elm-watch v1.2.0

elm-watch v1.2.0 #463

Workflow file for this run

name: Example
on:
push:
branches:
- "main"
pull_request:
jobs:
main:
runs-on: ubuntu-latest
defaults:
run:
working-directory: example
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version: 22
# Build elm-watch so we can use it in this example repo.
- name: Internal cache node_modules
id: internal-cache-node_modules
uses: actions/cache@v4
with:
path: node_modules
key: internal-node_modules-ubuntu-latest-22-${{ hashFiles('package.json', 'package-lock.json') }}
- name: Internal npm ci
if: steps.internal-cache-node_modules.outputs.cache-hit != 'true'
run: npm ci --no-audit
working-directory: .
- name: Internal build
run: npm run build
working-directory: .
- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@v4
with:
path: |
example/node_modules
example/public/submodules/seeds-game/node_modules
key: node_modules-${{ hashFiles('example/package.json', 'example/package-lock.json', 'example/public/submodules/seeds-game/package.json', 'example/public/submodules/seeds-game/package-lock.json') }}
- name: Cache ~/.elm
uses: actions/cache@v4
with:
path: ~/.elm
key: elm-${{ hashFiles('example/elm.json', 'example/elm-tooling.json') }}
- if: steps.cache-node_modules.outputs.cache-hit != 'true'
run: npm ci --no-audit
env:
NO_ELM_TOOLING_INSTALL: 1
- run: npx elm-tooling install
# This line is usually just `npx elm-watch make --optimize`,
# but we do some internal trickery here as a workaround specific to the elm-watch repo.
- run: PATH="$PWD/../tests/elm-bin:$PWD/node_modules/.bin:$PATH" elm-watch make --optimize
- run: npm run esbuild -- --minify
- run: npx elm-format --validate src