git.iko.soy/typeable/servant
on master help sign in
Cleanup
6452942Gaël Deest
.github/workflows/main.yml+11−21
@@ -1,6 +1,6 @@
1name: CI
1name: CI
2
2
3−# Trigger the workflow on push or pull request, but only for the main branch
3+# Trigger the workflow on push or pull request, but only for the master branch
4on:
4on:
5 pull_request:
5 pull_request:
6 push:
6 push:
@@ -21,15 +21,6 @@ jobs:
21 - "8.6.5"
21 - "8.6.5"
22 - "8.8.4"
22 - "8.8.4"
23 - "8.10.2"
23 - "8.10.2"
24− # exclude:
25− # - os: macOS-latest
26− # ghc: 8.8.4
27− # - os: macOS-latest
28− # ghc: 8.6.5
29− # - os: windows-latest
30− # ghc: 8.10.2
31− # - os: windows-latest
32− # ghc: 8.6.5
33
24
34 steps:
25 steps:
35 - uses: actions/checkout@v2
26 - uses: actions/checkout@v2
@@ -124,39 +115,38 @@ jobs:
124 stack test --system-ghc
115 stack test --system-ghc
125
116
126 ghcjs:
117 ghcjs:
127− name: stack / ghcjs 8.4
118+ name: cabal / ghcjs 8.4
128 runs-on: "ubuntu-18.04"
119 runs-on: "ubuntu-18.04"
129
120
130 steps:
121 steps:
131 - uses: actions/checkout@v2
122 - uses: actions/checkout@v2
123+ - name: "Setup PATH"
124+ run: |
125+ echo "PATH=$HOME/.cabal/bin:$PATH" >> $GITHUB_ENV
132
126
133− - name: Install ghcjs and tools
127+ - name: Install tools
134 run: |
128 run: |
135 sudo add-apt-repository ppa:hvr/ghcjs
129 sudo add-apt-repository ppa:hvr/ghcjs
136 sudo apt-get update -y
130 sudo apt-get update -y
137 sudo apt-get install ghcjs-8.4
131 sudo apt-get install ghcjs-8.4
138 sudo apt-get install cabal-install
132 sudo apt-get install cabal-install
139− cabal --version
133+
140 # Override cabal.project with the lightweight GHCJS one
134 # Override cabal.project with the lightweight GHCJS one
141 cp cabal.ghcjs.project cabal.project
135 cp cabal.ghcjs.project cabal.project
142 cat cabal.project
136 cat cabal.project
143
137
144− export PATH=/opt/ghcjs/8.4.4/bin:$PATH
145− export PATH="$HOME/.cabal/bin:$PATH"
146 cabal v2-update
138 cabal v2-update
147− ls /opt
148− ls /opt/ghcjs/8.4/bin
149− # cabal v2-install --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs --ignore-project hspec-discover
150 cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project cabal-plan --constraint='cabal-plan ^>=0.6.0.0' --constraint='cabal-plan +exe'
139 cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project cabal-plan --constraint='cabal-plan ^>=0.6.0.0' --constraint='cabal-plan +exe'
151 cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project hspec-discover
140 cabal v2-install -w /opt/ghc/8.4.4/bin/ghc --ignore-project hspec-discover
152
141
153 - name: Build
142 - name: Build
154 run: |
143 run: |
155− export PATH=/opt/ghcjs/8.4.4/bin:$PATH
156− export PATH="$HOME/.cabal/bin:$PATH"
157 cabal v2-build --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs --enable-tests --enable-benchmarks all
144 cabal v2-build --ghcjs -w /opt/ghcjs/8.4/bin/ghcjs --enable-tests --enable-benchmarks all
158
145
159 - name: Run tests
146 - name: Run tests
160 run: |
147 run: |
161− export PATH="$HOME/.cabal/bin:$PATH"
148+ # cabal v2-test does not work with GHCJS
149+ # See: https://github.com/haskell/cabal/issues/6175
150+ #
151+ # This invokes cabal-plan to figure out test binaries, and invokes them with node.
162 cabal-plan list-bins '*:test:*' | while read -r line; do testpkg=$(echo "$line" | perl -pe 's/:.*//'); testexe=$(echo "$line" | awk '{ print $2 }'); echo "testing $textexe in package $textpkg"; (cd "$(pkgdir $testpkg)" && nodejs "$testexe".jsexe/all.js); done
152 cabal-plan list-bins '*:test:*' | while read -r line; do testpkg=$(echo "$line" | perl -pe 's/:.*//'); testexe=$(echo "$line" | awk '{ print $2 }'); echo "testing $textexe in package $textpkg"; (cd "$(pkgdir $testpkg)" && nodejs "$testexe".jsexe/all.js); done