Skip to content

Merge branch 'main' into jie-valentines-day #116

Merge branch 'main' into jie-valentines-day

Merge branch 'main' into jie-valentines-day #116

Workflow file for this run

name: Elm Test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791
# 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@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: node_modules
key: node_modules-${{ hashFiles('package.json', 'package-lock.json') }}
restore-keys: |
node_modules-${{ hashFiles('package.json') }}
node_modules-
# 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@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: ~/.elm
key: elm-${{ hashFiles('elm-tooling.json', 'elm.json', 'review/elm.json') }}
restore-keys: |
elm-${{ hashFiles('elm-tooling.json', 'elm.json') }}
elm-${{ hashFiles('elm-tooling.json') }}
elm-
# 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
- name: Run Tests
run: npx elm-test-rs
- name: Check formatting
run: npx elm-format --validate src/ tests/ review/
- name: Run elm-review on source code
run: npx elm-review
check-website-copy-paths:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791
- name: Cache node_modules
id: cache-node_modules
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: node_modules
key: node_modules-${{ hashFiles('package.json', 'package-lock.json') }}
restore-keys: |
node_modules-${{ hashFiles('package.json') }}
node_modules-
- name: Cache ~/.elm
uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7
with:
path: ~/.elm
key: elm-${{ hashFiles('elm-tooling.json', 'elm.json', 'review/elm.json') }}
restore-keys: |
elm-${{ hashFiles('elm-tooling.json', 'elm.json') }}
elm-${{ hashFiles('elm-tooling.json') }}
elm-
- name: npm ci
if: steps.cache-node_modules.outputs.cache-hit != 'true'
env:
NO_ELM_TOOLING_INSTALL: 1
run: npm ci
- name: elm-tooling install
run: npx elm-tooling install
- name: Checkout the website-copy-repo
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791
with:
repository: exercism/website-copy
path: website-copy
- name: Check comment paths exist
run: |
./bin/build.sh
./bin/check_website-copy_paths.sh website-copy
smoke-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791
- name: Run Smoke Tests in Docker
run: bin/run-tests-in-docker.sh