-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (60 loc) · 1.74 KB
/
haskell.yml
File metadata and controls
71 lines (60 loc) · 1.74 KB
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
name: Haskell CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
strategy:
matrix:
os: [ linux, macos ]
arch: [ x86_64, aarch64 ]
exclude:
- os: macos
arch: x86_64
runs-on: ${{ matrix.arch == 'x86_64' && 'ubuntu-latest' || (matrix.os == 'linux' && 'ubuntu-24.04-arm' || 'macos-latest') }}
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
- name: ✅ Tag build artifacts
id: tag
shell: bash
run: |
echo "value=$GIT_SHA" >> $GITHUB_OUTPUT
env:
GIT_SHA: ${{ github.sha }}
- name: 🏗 Setup GHC
uses: haskell-actions/setup@v2
with:
ghc-version: '9.4.8'
cabal-version: '3.12.1.0'
- name: ❄ Cache
uses: actions/cache@v3
env:
cache-name: cache-cabal
with:
path: |
~/.cabal
~/.local
key: ${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-build-${{ env.cache-name }}-
${{ runner.os }}-${{ runner.arch }}-build-
${{ runner.os }}-${{ runner.arch }}-
- name: 🚄 Prepare OS
if: ${{ matrix.os == 'macos' }}
run: |
brew install autoconf automake libtool
- name: 🛠 Build
run: |
./build.hs
tar cvf artifact.tar -C bin db-server
- name: 🚢 Upload archive
uses: actions/upload-artifact@v4.4.0
with:
name: db-server-${{ steps.tag.outputs.value }}-${{ matrix.arch }}-${{ matrix.os }}
path: artifact.tar
overwrite: true