-
Notifications
You must be signed in to change notification settings - Fork 30
72 lines (63 loc) · 2.28 KB
/
test.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
name: Tests
on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
jobs:
test:
name: Test metadata
runs-on: [self-hosted, Linux, X64]
env:
YAML_VER: 0.0.9
GHC_VER: 9.8.4
CABAL_VER: 3.12.1.0
CACHE_BUST: 1
container:
image: rockylinux:9
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Disable cabal XDG
run: |
echo "CABAL_DIR=${GITHUB_WORKSPACE}/.cabal" >> "$GITHUB_ENV"
- name: Prerequisites
run: |
export TZ=Asia/Singapore
dnf install -y --allowerasing which findutils gcc gcc-c++ gmp gmp-devel make ncurses xz perl curl bash git nodejs zstd pkg-config pip libarchive-devel zlib-devel
mkdir -p "$HOME/.local/bin"
echo "$HOME/.local/bin" >> $GITHUB_PATH
pip install yamllint
shell: bash
- uses: haskell/ghcup-setup@v1
with:
ghc: ${{ env.GHC_VER }}
cabal: ${{ env.CABAL_VER }}
- name: Cache Cabal
uses: actions/cache@v4
env:
cache-name: cache-cabal
with:
path: |
.cabal/store
.cabal/packages
key: v${{ env.CACHE_BUST }}-${{ runner.os }}-${{ env.GHC_VER }}-${{ env.CABAL_VER }}-build-${{ hashFiles('cabal.project') }}
restore-keys: |
v${{ env.CACHE_BUST }}-${{ runner.os }}-${{ env.GHC_VER }}-${{ env.CABAL_VER }}-build-${{ hashFiles('cabal.project') }}
v${{ env.CACHE_BUST }}-${{ runner.os }}-${{ env.GHC_VER }}-${{ env.CABAL_VER }}-build-
v${{ env.CACHE_BUST }}-${{ runner.os }}-${{ env.GHC_VER }}
- name: Install ghcup-gen
run: |
cabal update
cabal install --installdir="$HOME/.local/bin" --overwrite-policy=always --install-method=copy ghcup-gen
shell: bash
- name: Check yaml
run: |
ghcup-gen -- check -f ghcup-${{ env.YAML_VER }}.yaml
yamllint ghcup-${{ env.YAML_VER }}.yaml
python3 -c "import yaml ; stream = open('ghcup-${{ env.YAML_VER }}.yaml', 'r') ; yaml.safe_load(stream)"
shell: bash
- name: Check tarballs
run: |
ghcup-gen -- check-tarballs -f ghcup-${{ env.YAML_VER }}.yaml -u 'ghcup-.*'
shell: bash