Skip to content

Commit 622de43

Browse files
committed
fix tests by using elm-test-rs
the node test runner does not like the hacks we do in ./tests/run-tests.sh. However elm-test-rs does not mind, it seems easier to switch test runner than to update the hacks for the node test runner. As an added extra we migrate CI from travis to github actions.
1 parent 8e99db3 commit 622de43

File tree

5 files changed

+56
-13
lines changed

5 files changed

+56
-13
lines changed

.github/workflows/ci.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
9+
jobs:
10+
main:
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
node-version: [14.x]
17+
18+
env:
19+
ELM_HOME: '${{ github.workspace }}/elm-stuff/elm-home'
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- uses: actions/setup-node@v1
25+
with:
26+
node-version: "${{ matrix.node-version }}"
27+
28+
- name: Cache node_modules
29+
id: cache-node_modules
30+
uses: actions/cache@v2
31+
with:
32+
path: node_modules
33+
key: node_modules-${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }}
34+
35+
- name: Cache ELM_HOME
36+
uses: actions/cache@v2
37+
with:
38+
path: '${{ env.ELM_HOME }}'
39+
key: elm-${{ matrix.os }}-${{ hashFiles('elm-tooling.json', 'elm/**/elm.json', 'example-*/**/elm.json', 'tests/**/elm.json') }}
40+
41+
- name: Install elm-tooling CLI
42+
if: steps.cache-node_modules.outputs.cache-hit != 'true'
43+
run: npm install --no-save elm-tooling
44+
45+
- name: elm-tooling install
46+
run: npx --no-install elm-tooling install
47+
48+
- name: test
49+
run: npx -c ./tests/run-tests.sh

.travis.yml

-11
This file was deleted.

elm-tooling.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"tools": {
3+
"elm": "0.19.1",
4+
"elm-test-rs": "1.0.0"
5+
}
6+
}

tests/run-tests.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -o nounset;
55

66
#let the caller supply an ELM_TEST binary if desired
77
if [ -z "${ELM_TEST:-}" ]; then
8-
ELM_TEST=elm-test;
8+
ELM_TEST=elm-test-rs
99
fi
1010

1111
# since elm/core is treated specially by the compiler (it's always

tests/tests/Main.elm

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Task exposing (..)
55
import Test exposing (..)
66
import Platform.Cmd exposing (Cmd)
77
import Json.Decode exposing (Value)
8-
import Test.Runner.Node exposing (run, TestProgram)
98
import Test.Array as Array
109
import Test.Basics as Basics
1110
import Test.Bitwise as Bitwise

0 commit comments

Comments
 (0)