🤖 Sync org-wide files to upstream repo #200
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: Elm Test | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
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-22.04 | |
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-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 | |
with: | |
install: true | |
- name: Build Docker image and store in cache | |
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 | |
with: | |
context: . | |
push: false | |
load: true | |
tags: elm-analyzer | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Run Smoke Tests in Docker | |
run: bin/run-tests-in-docker.sh | |
analyze-elm-repo-solutions: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout elm-analyzer | |
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c | |
- name: Checkout elm repo | |
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c | |
with: | |
repository: exercism/elm | |
path: elm_repo | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 | |
with: | |
install: true | |
- name: Build Docker image and store in cache | |
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 | |
with: | |
context: . | |
push: false | |
load: true | |
tags: elm-analyzer | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Run analyzer on all exercises | |
run: bin/analyze-all-exercises-in-docker.sh elm_repo |