66 push :
77 branches : [master, ghc-9.6-plinth]
88 workflow_dispatch :
9+ inputs :
10+ release :
11+ description : ' Build release bindists (with docs)'
12+ type : boolean
13+ default : false
914
1015jobs :
11- cabal :
12- name : ${{ matrix.os }} / ghc ${{ matrix.ghc }}
16+ build :
17+ name : Build / ${{ matrix.name }}
1318 runs-on : ${{ matrix.os }}
1419 strategy :
1520 fail-fast : false
1621 matrix :
17- os : [ubuntu-latest]
18- ghc : ['9.6.7']
22+ include :
23+ - name : x86_64-linux
24+ os : ubuntu-latest
25+ - name : aarch64-darwin
26+ os : macos-14
27+ - name : x86_64-darwin
28+ os : macos-13
29+ - name : x86_64-windows
30+ os : windows-latest
31+ env :
32+ RELEASE : ${{ inputs.release && '1' || '0' }}
33+ defaults :
34+ run :
35+ shell : bash
1936
2037 steps :
21-
2238 - name : Free disk space
39+ if : runner.os == 'Linux'
2340 uses : jlumbroso/free-disk-space@main
2441 with :
25- # this might remove tools that are actually needed,
26- # if set to "true" but frees about 6 GB
2742 tool-cache : false
28-
29- # all of these default to true, but feel free to set to
30- # "false" if necessary for your workflow
3143 android : true
3244 dotnet : true
3345 haskell : false
3446 large-packages : false
3547 docker-images : true
3648 swap-storage : true
3749
50+ - name : Configure git for Windows
51+ if : runner.os == 'Windows'
52+ run : git config --global core.symlinks true
53+
3854 - uses : actions/checkout@v4
3955 with :
4056 submodules : false
@@ -48,19 +64,124 @@ jobs:
4864
4965 - name : Init and update submodules
5066 run : |
51- git submodule sync
52- git submodule update --init --recursive
67+ git submodule sync
68+ git submodule update --init --recursive
69+
70+ - name : Setup MSYS2
71+ if : runner.os == 'Windows'
72+ uses : msys2/setup-msys2@v2
73+ with :
74+ msystem : MINGW64
75+ path-type : inherit
76+ update : false
77+ install : >-
78+ autoconf automake make tar xz patch curl
79+ mingw-w64-x86_64-python
5380
5481 - uses : haskell-actions/setup@v2
55- id : setup
5682 name : Setup Haskell tools
5783 with :
58- ghc-version : ${{ matrix.ghc }}
59- cabal-version : " latest"
84+ ghc-version : ' 9.6.7 '
85+ cabal-version : ' latest'
6086 cabal-update : true
6187
62- - name : Build uplc-ghc
88+ - name : Build bindist
6389 run : ./plinth-build.sh
90+ shell : ${{ runner.os == 'Windows' && 'msys2 {0}' || 'bash' }}
91+
92+ - name : Upload bindist
93+ uses : ./.github/actions/upload
94+ with :
95+ name : bindist-${{ matrix.name }}
96+ path : _build/bindist/*.tar.xz
97+
98+ - name : Upload metadata
99+ uses : ./.github/actions/upload
100+ with :
101+ name : metadata-${{ matrix.name }}
102+ path : _build/bindist/*-ghcup-metadata.yaml
103+
104+ test :
105+ name : Test / ${{ matrix.name }}
106+ needs : build
107+ runs-on : ${{ matrix.os }}
108+ strategy :
109+ fail-fast : false
110+ matrix :
111+ include :
112+ - name : x86_64-linux
113+ os : ubuntu-latest
114+ - name : aarch64-darwin
115+ os : macos-14
116+ - name : x86_64-darwin
117+ os : macos-13
118+ - name : x86_64-windows
119+ os : windows-latest
120+ defaults :
121+ run :
122+ shell : bash
123+
124+ steps :
125+ - uses : actions/checkout@v4
126+ with :
127+ submodules : false
128+
129+ # Submodules are needed on Unix for the plinth test suite
130+ # (run as part of verify-bindist-relocatable.sh)
131+ - name : Setup SSH for submodules
132+ if : runner.os != 'Windows'
133+ run : |
134+ mkdir -p ~/.ssh
135+ echo "${{ secrets.SUBMODULE_SSH_KEY }}" > ~/.ssh/id_rsa
136+ chmod 600 ~/.ssh/id_rsa
137+ ssh-keyscan github.com >> ~/.ssh/known_hosts
138+
139+ - name : Init and update submodules
140+ if : runner.os != 'Windows'
141+ run : |
142+ git submodule sync
143+ git submodule update --init --recursive
144+
145+ - name : Setup MSYS2
146+ if : runner.os == 'Windows'
147+ uses : msys2/setup-msys2@v2
148+ with :
149+ msystem : MINGW64
150+ path-type : inherit
151+ update : false
152+ install : tar xz
153+
154+ - uses : haskell-actions/setup@v2
155+ if : runner.os != 'Windows'
156+ name : Setup Haskell tools
157+ with :
158+ ghc-version : ' 9.6.7'
159+ cabal-version : ' latest'
160+ cabal-update : true
161+
162+ - name : Download bindist
163+ uses : ./.github/actions/download
164+ with :
165+ name : bindist-${{ matrix.name }}
166+ path : _build/bindist/
64167
65- # - name: Test uplc-ghc
66- # run: ./plinth-test.sh
168+ - name : Verify bindist
169+ if : runner.os != 'Windows'
170+ run : ./verify-bindist-relocatable.sh
171+
172+ # On Windows the bindist has no configure script; verify by
173+ # extracting and running the relocatable binaries directly.
174+ - name : Verify bindist (Windows)
175+ if : runner.os == 'Windows'
176+ shell : msys2 {0}
177+ run : |
178+ tarball=(_build/bindist/*.tar.xz)
179+ dir=$(basename "$tarball" .tar.xz)
180+ mkdir -p _test/bindist
181+ tar -xf "$tarball" -C _test/bindist
182+ echo "=== uplc-ghc --version ==="
183+ _test/bindist/"$dir"/bin/uplc-ghc.exe --version
184+ echo "=== uplc-ghc -e ==="
185+ _test/bindist/"$dir"/bin/uplc-ghc.exe -e 'putStrLn "hello"'
186+ echo "=== ghc-pkg check ==="
187+ _test/bindist/"$dir"/bin/ghc-pkg.exe check --no-user-package-db
0 commit comments