Skip to content

Commit deaf264

Browse files
authored
fix ci run command (#174)
* fix ci run command * Remove .travis.yml * Do not run haskell in CI * Remove npm deps and split test and format scripts * Update CI to use npm scripts * Make npm test windows-compatible * Change current directory within test.sh script * Try changing bash shebang to solve windows issue * Try re-adding the './' prefix to npm test scripts * Try prefixing npm test scripts with bash * Print PATH to look for clues * Specify shell: bash in CI * CI run tests both without and with npm * Remove windows from CI * Just use npm test in CI * Remove debug print from test.sh
1 parent a5fa136 commit deaf264

File tree

5 files changed

+16
-26
lines changed

5 files changed

+16
-26
lines changed

.github/workflows/ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
# Run on Mac, Windows, and Linux, for multiple Node versions
18-
os: [macos-latest, windows-latest, ubuntu-latest]
17+
# Run on Mac and Linux, for multiple Node versions
18+
os: [macos-latest, ubuntu-latest]
1919
node: ['8', '10', '12', '14']
2020

2121
env:
@@ -38,7 +38,7 @@ jobs:
3838
cache-restore-key: tests-${{ matrix.os }}-node${{ matrix.node }}
3939

4040
- name: Run the tests
41-
run: ./tests/make.sh && (cd tests && ./tests.sh)
41+
run: npm test
4242

4343
check_formatting:
4444
# This job is to check the formatting of files
@@ -56,4 +56,4 @@ jobs:
5656
cache-restore-key: format-${{ matrix.os }}-node${{ matrix.node }}
5757

5858
- name: Check formatting
59-
run: elm-format --validate src tests/src benchmarks
59+
run: npm run format

.travis.yml

-12
This file was deleted.

package.json

+4-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33
"version": "0.0.0",
44
"description": "tests for elm-test, so you can elm-test while you elm-test",
55
"scripts": {
6-
"test": "./tests/make.sh && (cd tests && ./test.sh) && elm-format --validate src tests/src benchmarks"
6+
"pre-test": "bash tests/make.sh",
7+
"test": "bash tests/test.sh",
8+
"format": "elm-format --validate src tests/src benchmarks"
79
},
810
"author": "Richard Feldman",
9-
"license": "BSD-3-Clause",
10-
"devDependencies": {
11-
"elm": "latest-0.19.1",
12-
"elm-format": "latest-0.19.1"
13-
},
14-
"dependencies": {}
11+
"license": "BSD-3-Clause"
1512
}

tests/make.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
set -eu
44

tests/test.sh

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
set -ex
44

5+
# Change current working directory to this one.
6+
cd "${0%/*}"
7+
58
rm -f elm.js
69
rm -Rf elm-stuff
710
rm -Rf elm_home/0.19.1/packages/elm-explorations/test
@@ -13,7 +16,9 @@ PACKAGE_VERSION=`grep \"version ../elm.json | cut -d \" -f 4`
1316
mkdir -p elm_home/0.19.1/packages/elm-explorations/test/${PACKAGE_VERSION}
1417
rsync -va ../ elm_home/0.19.1/packages/elm-explorations/test/${PACKAGE_VERSION}/ --exclude tests --exclude elm-stuff --exclude .git --exclude node_modules
1518

16-
if which runhaskell; then
19+
if [ "$CI" = true ]; then
20+
echo "Running in CI"
21+
elif which runhaskell; then
1722
# this produces ./versions.dat, but that file
1823
# is checked in, so it's fine to skip regenerating if
1924
# haskell is not available (such as on CI)

0 commit comments

Comments
 (0)