elm-tooling-cli v1.15.0 #418
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Example | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
# Skip this and remove all references to `example` if you have | |
# stuff at the repo root. | |
working-directory: example | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
# Choose your Node.js version here: | |
node-version: 18.x | |
# IGNORE START: This is just internal stuff specific for this repo. | |
- name: Internal cache node_modules | |
id: internal-cache-node_modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: internal-node_modules-ubuntu-latest-18.x-${{ hashFiles('package.json', 'package-lock.json') }} | |
- name: Internal npm ci | |
if: steps.internal-cache-node_modules.outputs.cache-hit != 'true' | |
run: npm ci | |
working-directory: . | |
- name: Internal build | |
run: npm run build | |
working-directory: . | |
# IGNORE END | |
# Re-use node_modules between runs until package.json or package-lock.json changes. | |
- name: Cache node_modules | |
id: cache-node_modules | |
uses: actions/cache@v3 | |
with: | |
path: example/node_modules | |
key: node_modules-${{ hashFiles('example/package.json', 'example/package-lock.json') }} | |
# Re-use ~/.elm between runs until elm.json, elm-tooling.json or | |
# review/elm.json changes. The Elm compiler saves downloaded Elm packages | |
# to ~/.elm, and elm-tooling saves downloaded tool executables there. | |
- name: Cache ~/.elm | |
uses: actions/cache@v3 | |
with: | |
path: ~/.elm | |
key: elm-${{ hashFiles('example/elm.json', 'example/elm-tooling.json', 'example/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. | |
# `npm ci` does two things: | |
# 1. Installs everything in package-lock.json. | |
# 2. Checks that package.json and package-lock.json are in sync. | |
# That’s why the cache depends on both package-lock.json and package.json. | |
- name: npm ci | |
if: steps.cache-node_modules.outputs.cache-hit != 'true' | |
env: | |
# If you have a `"postinstall": "elm-tooling install"` script in your | |
# package.json, this turns it into a no-op. We’ll run it in the next | |
# step because of the caching. If elm-tooling.json changes but | |
# package-lock.json does not, the postinstall script needs running | |
# but this step won’t. | |
NO_ELM_TOOLING_INSTALL: 1 | |
run: npm ci | |
# Install tools from elm-tooling.json, unless we restored them from | |
# cache. package-lock.json and elm-tooling.json can change independently, | |
# so we need to install separately based on what was restored from cache. | |
# This is run even if we restored ~/.elm from cache to be 100% sure | |
# node_modules/.bin/ contains links to all your tools. `elm-tooling | |
# install` runs very fast when there’s nothing new to download so | |
# skipping the step doesn’t save much time. | |
- name: elm-tooling install | |
run: npx elm-tooling install | |
# Finally, run whatever you want. For example: | |
- name: elm make | |
run: npx elm make src/Main.elm --output=/dev/null | |
- name: elm-test | |
run: npx elm-test | |
- name: elm-review | |
run: npx elm-review | |
- name: elm-format | |
run: npx elm-format --validate . | |
- name: prettier | |
run: npx prettier --check . | |
- name: build | |
run: npm run build | |
- name: Internal test exports | |
run: node scripts/TestExports.cjs && node scripts/TestExports.mjs |