-
Notifications
You must be signed in to change notification settings - Fork 2
116 lines (95 loc) · 4.76 KB
/
ubuntu.yml
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
name: Ubuntu
on: delete
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
ghc: ['9.0.1']
cabal: ['3.4.0.0']
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Setup Haskell
uses: haskell/actions/setup@v1
id: setup-haskell-cabal
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Freeze
run: |
cabal freeze
- name: Cache cabal
uses: actions/cache@v2
id: cache-cabal
with:
path: '~/.cabal'
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('/src/Main.hs') }}-a
- name: Cache dist
uses: actions/cache@v2
id: cache-bin
with:
path: '/dist-newstyle/'
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('/src/Main.hs') }}-b
- name: cabal update and build
run: cabal v2-build --enable-tests
- name : make directory
run: |
mkdir binary
mkdir binary/haskell-libs/
mkdir binary/c-libs/
ls
- name: move GHC libs and configs
run: |
mkdir binary/haskell-libs/ghc-packages/
cd ${{ steps.setup-haskell-cabal.outputs.ghc-path }}
cd ..
cd lib
cp -r ghc-${{ matrix.ghc }}/* /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/ghc-packages
- name: move installed packages
run: |
mkdir binary/haskell-libs/packages/
cp -r ${{ steps.setup-haskell-cabal.outputs.cabal-store }}/ghc-${{ matrix.ghc }}/* binary/haskell-libs/packages
ls binary/haskell-libs/packages
- name: change paths in config files (GHC)
run: |
mv /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/ghc-packages/package.conf.d /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/package.conf.d
sed -i 's/\/opt\/ghc\/${{ matrix.ghc }}\/lib\/ghc-${{ matrix.ghc }}/${pkgroot}\/ghc-packages/g' /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/package.conf.d/*
- name: change paths in config files (cabal)
run: |
mv /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/packages/package.db /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/package.db
sed -i 's/\/home\/runner\/.cabal\/store\/ghc-${{ matrix.ghc }}/${pkgroot}\/packages/g' /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/package.db/*
- name: move ghc settings etc
run: |
mv /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/ghc-packages/settings /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/settings
mv /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/ghc-packages/platformConstants /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/platformConstants
mv /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/ghc-packages/llvm-targets /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/llvm-targets
mv /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/ghc-packages/llvm-passes /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/llvm-passes
- name: ghc-pkg recache
run: |
ghc-pkg --package-db=/home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/package.conf.d recache
ghc-pkg --package-db=/home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/package.db recache
ghc-pkg --package-db=/home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/package.conf.d --package-db=/home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/package.db check
- name: move c-libs
run: ls /usr/lib/x86_64-linux-gnu/
- name: remove unneccessary libs
run: |
cd /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/ghc-packages
rm -r ghc-${{ matrix.ghc }}
rm -r Cabal-${{ matrix.cabal }}
rm -r rts
- name: fake gcc
run: |
mkdir binary/bin
cp -r fake_gcc.sh binary/bin/fake_gcc.sh
sed -i 's/cc/bin\/fake_gcc.sh/g' /home/runner/work/tidal-deploy/tidal-deploy/binary/haskell-libs/settings
- name: move executable
run: cp -r dist-newstyle/build/x86_64-linux/ghc-9.0.1/my-program-0.1.0.0/x/my-program/build/my-program/my-program binary/my-program
- name: zip files
run: |
cd /home/runner/work/tidal-deploy/tidal-deploy/
tar cvfj binary.tar binary/*
- uses: actions/upload-artifact@v2
with:
name: my-program
path: /home/runner/work/tidal-deploy/tidal-deploy/binary.tar