-
-
Notifications
You must be signed in to change notification settings - Fork 2
110 lines (106 loc) · 3.35 KB
/
ci.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
name: CI
on: push
jobs:
dependencies:
runs-on: ${{ matrix.os }}
env:
STACK_YAML: ${{ github.workspace }}/stack-${{ matrix.ghc }}.yaml
strategy:
fail-fast: false
matrix:
ghc: ['9.4', '9.6']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Download Stack
run: ./ci/download-stack.sh
- name: Cache Dependencies
uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles(env.STACK_YAML, format('{0}.lock', env.STACK_YAML)) }}
restore-keys: |
${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles(env.STACK_YAML, format('{0}.lock', env.STACK_YAML)) }}
${{ matrix.os }}-${{ matrix.ghc }}
- name: Install dependencies
run: ./stack build --test --only-dependencies
tests:
runs-on: ${{ matrix.os }}
needs: dependencies
env:
STACK_YAML: ${{ github.workspace }}/stack-${{ matrix.ghc }}.yaml
strategy:
fail-fast: false
matrix:
ghc: ['9.4', '9.6']
os: [ubuntu-latest]
project:
- aws-checkip
- aws-rds
- aws-secrets
- aws-temporary-ingress-rule
- bounded
- cbt
- conversions
- dbt
- devtools
- http-mclient
- lambda-alb
- lambda-runtime
- lht
- mio-amazonka
- mio-core
- mio-log
- oauth
- openapi
- pgt
- source-constraints
- stack-deploy
- tasty-mgolden
- xray
steps:
- uses: actions/checkout@v3
- name: Download Stack
run: ./ci/download-stack.sh
- name: Cache Dependencies
uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles(env.STACK_YAML, format('{0}.lock', env.STACK_YAML)) }}
restore-keys: |
${{ matrix.os }}-${{ matrix.ghc }}-${{ hashFiles(env.STACK_YAML, format('{0}.lock', env.STACK_YAML)) }}
${{ matrix.os }}-${{ matrix.ghc }}
- name: Install dependencies
run: ./stack build --test --only-dependencies
- name: Build
if: matrix.project != 'pgt'
run: ./stack build --fast --test --no-run-tests ${{ matrix.project }}
- name: Build pgt binary
if: matrix.project == 'pgt'
run: ./stack build --fast --test --no-run-tests --copy-bins --flag pgt:build-executable ${{ matrix.project }}
- name: Run tests
run: ./stack build --fast --test ${{ matrix.project }}
- name: Add pgt binary artifact
if: matrix.project == 'pgt'
uses: actions/upload-artifact@v3
with:
name: pgt-linux-x86-64
path: /home/runner/.local/bin/pgt
if-no-files-found: error
- name: Upload latest pgt release
if: ${{ matrix.project == 'pgt' && github.ref == 'refs/heads/main' }}
run: |
name=pgt-latest-linux-x86-64
# Initialize the latest release
gh release create "$name" --title "$name" --notes 'Latest linux x86 release of pgt' --repo ${{ github.repository }} 2> /dev/null || true
# Upload the latest release
gh release upload "$name" "$HOME/.local/bin/pgt" --clobber --repo ${{ github.repository }}
env:
GH_TOKEN: ${{ github.token }}
all-checks:
runs-on: ubuntu-latest
name: All Checks Pass
needs:
- tests
steps:
- run: exit 0