Skip to content

Commit 6907ca0

Browse files
authored
Merge pull request #5218 from commercialhaskell/update-azure-doc
Update documentation related to Azure CI
2 parents effa148 + 612b5c8 commit 6907ca0

File tree

3 files changed

+24
-59
lines changed

3 files changed

+24
-59
lines changed

doc/azure/azure-pipelines.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ jobs:
1414
- template: azure-linux-template.yml
1515
parameters:
1616
name: Linux
17-
vmImage: ubuntu-18.04
17+
vmImage: ubuntu-latest
1818
os: linux
1919

2020
- template: azure-osx-template.yml
2121
parameters:
2222
name: macOS
23-
vmImage: macOS-10.14
23+
vmImage: macOS-latest
2424
os: osx
2525

2626
- template: azure-windows-template.yml
2727
parameters:
2828
name: Windows
29-
vmImage: vs2017-win2016
29+
vmImage: windows-latest
3030
os: windows

doc/azure/azure-simple.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# Choose a agent virtual image
1212
pool:
13-
vmImage: ubuntu-16.04
13+
vmImage: ubuntu-latest
1414

1515
steps:
1616
- script: |

doc/azure_ci.md

Lines changed: 20 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,9 @@ used on your projects:
3030
with just the settings present in your `stack.yaml` file.
3131
* The complex Azure configuration is intended for projects that need
3232
to support multiple GHC versions and multiple OSes, such as open
33-
source libraries to be released to Hackage. It tests against
34-
cabal-install, as well as Stack on Linux and macOS. The
35-
configuration is significantly more involved to allow for all of
36-
this branching behavior. In the provided template, we use the Linux
37-
build configuration to test against various combinations of
38-
cabal-install and stack. The macOS and Windows configuration is used
39-
only for testing Stack build configuration. These are the files for
40-
the complex configuration:
33+
source libraries to be released to Hackage. It tests against Stack
34+
for different resolves on Linux, macOS and Windows. These are the
35+
files for the complex configuration:
4136
- [azure-pipelines.yml](https://raw.githubusercontent.com/commercialhaskell/stack/stable/doc/azure/azure-pipelines.yml) : This is the starter file used by the Azure CI.
4237
- [azure-linux-template.yml](https://raw.githubusercontent.com/commercialhaskell/stack/stable/doc/azure/azure-linux-template.yml) : Template for Azure Linux build
4338
- [azure-osx-template.yml](https://raw.githubusercontent.com/commercialhaskell/stack/stable/doc/azure/azure-osx-template.yml) : Template for Azure macOS build
@@ -100,19 +95,14 @@ specify which virtual image you want to choose using this configuration:
10095

10196
``` yaml
10297
pool:
103-
vmImage: ubuntu-16.04
98+
vmImage: ubuntu-latest
10499
```
105100
106-
The other popular options are `macOS-10.13`, `vs2017-win2016` for Mac
101+
The other popular options are `macOS-latest`, `windows-latest` for Mac
107102
and Windows respectively. You can find the [complete
108103
list](https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=vsts&tabs=yaml)
109-
here.
110-
111-
Note that as of now, Azure CI doesn't offer any caching support. You
112-
can use something like [cache-s3](https://github.com/fpco/cache-s3)
113-
for explicit caching, although it may cost you. For a project with an
114-
example usage of `cache-s3`, you can see the Azure configuration of
115-
[stack](https://github.com/commercialhaskell/stack) repository.
104+
here. You also have the option to select a specific supported ubuntu
105+
version like `ubuntu-18.08`.
116106

117107
## Installing Stack
118108

@@ -134,63 +124,38 @@ There are two ways to install GHC:
134124
- Install GHC using apt package manger. This method is only applicable
135125
for Debian based images.
136126

137-
See the [simple azure
138-
script](https://raw.githubusercontent.com/commercialhaskell/stack/stable/doc/azure/azure-simple.yml)
139-
for an example of the first option (letting Stack download GHC). Here,
140-
we will show the second option:
141-
142-
```yaml
143-
sudo add-apt-repository -y ppa:hvr/ghc
144-
sudo apt-get update
145-
sudo apt-get install cabal-install-$CABALVER ghc-$GHCVER
146-
```
147-
148-
For the above commands to work, you need to set the `CABALVER` and
149-
`GHCVER` environment variable properly.
127+
But we only use the first method of using Stack to download GHC.
150128

151129
### Multiple GHC - parametrised builds
152130

153131
For different GHC versions, you probably want to use different
154132
`stack.yaml` files. If you don't want to put a specific `stack.yaml`
155133
for a particular resolver and still want to test it, you have specify
156134
your resolver argument in `ARGS` environment variable (you will see an
157-
example below). For cabal based builds, you have to specify both
158-
`GHCVER` and `CABALVER` environment variables.
159-
135+
example below).
160136
```
161137
strategy:
162138
matrix:
163-
stack-def:
164-
BUILD: stack
165-
STACK_YAML: stack.yaml
166-
stack-lts-13:
167-
BUILD: stack
168-
STACK_YAML: stack-lts-13.yaml
169-
cabal-8.4.4:
170-
BUILD: cabal
171-
GHCVER: 8.4.4
172-
CABALVER: 2.4
173-
cabal-8.6.5:
174-
BUILD: cabal
175-
GHCVER: 8.6.5
176-
CABALVER: 2.4
139+
GHC 8.0:
140+
ARGS: "--resolver lts-9"
141+
GHC 8.2:
142+
ARGS: "--resolver lts-11"
143+
GHC 8.4:
144+
ARGS: "--resolver lts-12"
145+
GHC 8.6:
146+
ARGS: "--resolver lts-14"
147+
GHC 8.8:
148+
ARGS: "--resolver lts-15"
177149
nightly:
178-
BUILD: stack
179150
ARGS: "--resolver nightly"
180-
style:
181-
BUILD: style
182-
pedantic:
183-
BUILD: pedantic
184-
STACK_YAML: stack.yaml
185151
```
186152
187153
## Running tests
188154
189155
After the environment setup, actual test running is simple:
190156
191157
```yaml
192-
script:
193-
- stack test
158+
stack $ARGS test --bench --no-run-benchmarks --haddock --no-haddock-deps
194159
```
195160

196161
## Other details

0 commit comments

Comments
 (0)