-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (112 loc) · 4.57 KB
/
integration-test-suite.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
################################################################################
### GitHub Actions curation providing quality assurance for Haskell projects
###
name: 'PHANE Integration Test CI'
################################################################################
### Actions Configuration
###
defaults:
run:
shell: bash
env:
PROJECTFILE: --project-file=config/cabal.project.integration
TESTDETAILS: --test-show-details=streaming
TESTOPTIONS: --test-options="--timeout=30s"
THISMAINEXE: PhyGraph:phyg
THISTESTEXE: PHAGE-integration-tests:integration-tests
on:
# Build every pull request, to check for regressions.
pull_request:
branches: [ main ]
# Build on branch updates
push:
branches: [ main, github-ci ]
# INFO: The following configuration block ensures that only one build runs per branch,
# which may be desirable for projects with a costly build process.
# Remove this block from the CI workflow to let each CI job run to completion.
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
################################################################################
### Actions: Curation
###
jobs:
################################################################################
### Check that all test cases pass
###
testing:
# NOTE:
# Do *not* include macOS in *any* benchmarking/testing build matrix!
# Only include macOS in build matrices checking for compilation success.
# - macOS consumes x10 the free Linux CI minutes
# - macOS bills at x10 the paid Linux CI minute rate
#
name: 'Test: Integration'
runs-on: ubuntu-latest
strategy:
fail-fast: true
steps:
- name: 'Clone Project'
uses: actions/checkout@v4
- name: 'Setup Haskell'
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: 9.10.1
cabal-version: 3.12
cabal-update: true
- name: 'Cabal - Configure'
run: |
cabal update ${PROJECTFILE}
cabal clean ${PROJECTFILE}
cabal freeze ${PROJECTFILE}
cabal configure ${PROJECTFILE} --enable-tests --enable-benchmarks --disable-documentation
cabal build all ${PROJECTFILE} --dry-run
# The last step generates dist-newstyle/cache/plan.json for the cache key.
- name: 'Cabal - Cache [1]'
uses: actions/cache/restore@v4
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-
- name: 'Cabal - Install dependencies'
# If we had an exact cache hit, the dependencies will be up to date.
if: steps.cache.outputs.cache-hit != 'true'
run: cabal build all --only-dependencies
# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
- name: 'Cabal - Cache [2]'
uses: actions/cache/save@v4
# If we had an exact cache hit, trying to save the cache would error because of key clash.
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: 'Cabal - Build'
run: |
cabal build ${THISMAINEXE} ${THISTESTEXE} ${PROJECTFILE} --only-dependencies
- name: 'Cabal - Integration Tests'
run: |
cabal test ${THISTESTEXE} ${PROJECTFILE} ${TESTDETAILS} ${TESTOPTIONS}
# - name: Send mail on failure
# if: ${{ failure() }}
# uses: dawidd6/action-send-mail@v3
# with:
# # Mail server settings
# ignore_cert: true
# secure: true
# server_address: smtp.domain.com
# server_port: 465
#
# # Sender credentials
# username: ${{ secrets.EMAIL_USERNAME }}
# password: ${{ secrets.EMAIL_PASSWORD }}
#
# # Recipient & email information
# to: [email protected]
# cc: [email protected]
# from: PHANE ρbit
# subject: "PHANE CI Failure: Integration Test-suite - job ${{ github.job }}"
# body: "The continuous integration performed by GitHub Workflows has failed!\n\nInspect job ${{ github.job.name }} numbered ${{ github.job }} at:\n\n https://github.com/${{ github.repository }}actions.\n\n\nVigilantly,\n ~ PHANE ρbit"