-
Notifications
You must be signed in to change notification settings - Fork 70
86 lines (72 loc) · 2.5 KB
/
packdiff.yml
File metadata and controls
86 lines (72 loc) · 2.5 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: API
on:
workflow_dispatch:
pull_request:
jobs:
packdiff:
name: "Signature diff: master vs PR"
env:
GHCVER: 9.8.4
GHCUP_VERSION: 0.1.50.2
runs-on: ubuntu-latest
steps:
# This should happen before cache restore.
- name: Remove ~/.ghcup symlink
run: |
rm -f ~/.ghcup
- name: Cache ghcup and ghc (non-Windows)
uses: actions/cache@v4
if: runner.os != 'Windows'
with:
path: |
~/.ghcup
key: ${{ runner.os }}-ghcup-${{ env.GHCUP_VERSION }}-${{ env.GHCVER }}
- name: Cache hackage package index (non-Windows)
uses: actions/cache@v4
if: runner.os != 'Windows'
with:
path: |
~/.cache/cabal/packages
# Bump the key version to clear the cache
key: cache-cabal-packages
- name: Cache packdiff (non-Windows)
uses: actions/cache@v4
if: runner.os != 'Windows'
with:
path: |
~/.local/bin
~/.local/state/cabal
# Bump the key version to clear the cache
key: packdiff-ghc-${{ env.GHCVER }}
- name: Checkout the current branch
uses: actions/checkout@v4
with:
fetch-depth: 0
# Use a sane PATH, especially to pick the right GHC
- name: Set PATH to add .local and .ghcup
run: echo "$HOME/.local/bin:$HOME/.ghcup/bin:/bin:/usr/bin" > $GITHUB_PATH
- name: Download ghc
run: |
if ! ghc --version 2>/dev/null | grep -q "$GHCVER"
then
curl -sL -o ./ghcup https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION
chmod +x ./ghcup
export GHCUP_INSTALL_BASE_PREFIX=$HOME
./ghcup install ghc $GHCVER
./ghcup set ghc $GHCVER
./ghcup install cabal
fi
# XXX update only if not present
cabal update
- name: Install packdiff
run: |
if [ ! -f $HOME/.local/bin/packdiff ]; then
mkdir -p $HOME/.local/bin
# IMPORTANT: do not replace $HOME with ~, tilde is not expanded by
# shell in the middle of a command string.
cabal install packdiff --project-file=cabal.project.packdiff --installdir=$HOME/.local/bin --overwrite-policy=always
fi
- name: API diff for streamly-core
run: packdiff diff streamly-core $(git rev-parse origin/master) streamly-core $(git rev-parse HEAD)
- name: API diff for streamly
run: packdiff diff streamly $(git rev-parse origin/master) streamly $(git rev-parse HEAD)