-
Notifications
You must be signed in to change notification settings - Fork 379
784 lines (732 loc) · 27 KB
/
ci-idris2-and-libs.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
name: Idris2 and External Libs
on:
push:
branches:
- '*'
tags:
- '*'
paths-ignore:
- 'docs/**'
- 'icons/**'
- 'Release/**'
- '**.md'
- 'CONTRIBUTORS'
- 'LICENSE'
- 'CHANGELOG.md'
- '.github/workflows/ci-bootstrap.yml'
- '.github/workflows/ci-lint.yml'
- '.github/workflows/ci-sphinx.yml'
- '.github/workflows/ci-super-linter.yml'
pull_request:
branches:
- main
paths-ignore:
- 'docs/**'
- 'icons/**'
- 'Release/**'
- '**.md'
- 'CONTRIBUTORS'
- 'LICENSE'
- '.github/workflows/ci-bootstrap.yml'
- '.github/workflows/ci-lint.yml'
- '.github/workflows/ci-sphinx.yml'
- '.github/workflows/ci-super-linter.yml'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
env:
# We aim to keep newest Idris commits buildable by as early of a
# previous version as possible. In reality, we bump this regularly
# to allow us to use new compiler/library features in the compiler
# codebase, but an admirable longterm goal is to support building the
# current version of the compiler with a previous version that is older
# than its immediate predecessor.
IDRIS2_MINIMUM_COMPAT_VERSION: 0.7.0
jobs:
initialise:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
# for pull_request so we can do HEAD^2
fetch-depth: 2
- name: Get commit message
id: get_commit_message
run: |
if [[ '${{ github.event_name }}' == 'push' ]]; then
echo "commit_message=$(git log --format=%B -n 1 HEAD | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
elif [[ '${{ github.event_name }}' == 'pull_request' ]]; then
echo "commit_message=$(git log --format=%B -n 1 HEAD^2 | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
fi
outputs:
commit_message:
echo "${{ steps.get_commit_message.outputs.commit_message }}"
######################################################################
# Build from the previous version
# We perform this check before all the other ones because:
# 1. It is fast
# 2. If it fails then there is no point in trying the rest
######################################################################
quick-check:
needs: initialise
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci: skip]')
env:
IDRIS2_CG: chez
SCHEME: scheme
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
# Get our hands on the released version either by using the cache
# or by rebuilding it if necessary.
- name: Cache Chez Previous Version
id: previous-version-cache
uses: actions/cache@v4
with:
path: Idris2-${{ env.IDRIS2_MINIMUM_COMPAT_VERSION }}
key: ${{ runner.os }}-idris2-bootstrapped-chez-${{ env.IDRIS2_MINIMUM_COMPAT_VERSION }}
- name : Build previous version
if: steps.previous-version-cache.outputs.cache-hit != 'true'
run: |
wget "https://github.com/idris-lang/Idris2/archive/refs/tags/v$IDRIS2_MINIMUM_COMPAT_VERSION.tar.gz" -O "idris2-$IDRIS2_MINIMUM_COMPAT_VERSION.tgz"
tar zxvf "idris2-$IDRIS2_MINIMUM_COMPAT_VERSION.tgz"
cd "Idris2-$IDRIS2_MINIMUM_COMPAT_VERSION"
make bootstrap
cd ..
- name: Install previous version
run: |
cd "Idris2-$IDRIS2_MINIMUM_COMPAT_VERSION"
make install
cd ..
# Build the current version and save the installation.
- name: Build current version
run: |
make && make install
- name: Artifact Idris2 from previous version
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: ubuntu-installed-idris2-${{ env.IDRIS2_MINIMUM_COMPAT_VERSION }}-chez
path: ~/.idris2/
######################################################################
# Bootstrapping builds
######################################################################
# CHEZ
ubuntu-bootstrap-chez:
needs: [initialise, quick-check]
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: ubuntu]')
|| contains(needs.initialise.outputs.commit_message, '[ci: chez]')
env:
IDRIS2_CG: chez
SCHEME: scheme
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
- name: Make bootstrap folder readonly
run: chmod -R a-w bootstrap
- name: Build from bootstrap
run: make bootstrap && make install
- name: Artifact Bootstrapped Idris2
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: ubuntu-installed-bootstrapped-idris2-chez
path: ~/.idris2/
macos-bootstrap-chez:
needs: [initialise, quick-check]
runs-on: macos-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: macos]')
|| contains(needs.initialise.outputs.commit_message, '[ci: chez]')
env:
SCHEME: chez
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build dependencies
run: |
brew update
brew install --overwrite python@3.12
brew install node
brew install chezscheme
brew install coreutils
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
- name: Make bootstrap folder readonly
run: chmod -R a-w bootstrap
- name: Build Idris 2 from bootstrap
run: make bootstrap && make install
shell: bash
- name: Artifact Bootstrapped Idris2
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: macos-installed-bootstrapped-idris2-chez
path: ~/.idris2/
windows-bootstrap-chez:
needs: [initialise, quick-check]
runs-on: windows-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: windows]')
|| contains(needs.initialise.outputs.commit_message, '[ci: chez]')
|| contains(needs.initialise.outputs.commit_message, '[ci: racket]')
env:
MSYSTEM: MINGW64
MSYS2_PATH_TYPE: inherit
SCHEME: scheme
CC: gcc
steps:
- name: Init
run: |
git config --global core.autocrlf false
- name: Checkout
uses: actions/checkout@v4
- name: Get Chez Scheme
run: |
git clone --depth 1 --branch v9.5.8a https://github.com/cisco/ChezScheme
c:\msys64\usr\bin\bash -l -c "pacman -S --noconfirm tar make mingw-w64-x86_64-gcc"
echo "PWD=$(c:\msys64\usr\bin\cygpath -u $(pwd))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Configure and Build Chez Scheme
run: |
c:\msys64\usr\bin\bash -l -c "cd $env:PWD && cd ChezScheme && ./configure --threads && make"
- name: Set Path
run: |
$chez="$(pwd)\ChezScheme\ta6nt\bin\ta6nt"
$idris="$(pwd)\.idris2"
echo "$chez" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "$idris\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "IDRIS_PREFIX=$idris" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "PREFIX=$(c:\msys64\usr\bin\cygpath -u $idris)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Test Scheme
run: |
scheme --version
- name: Bootstrap
run: c:\msys64\usr\bin\bash -l -c "cd $env:PWD && make bootstrap"
- name: Bootstrap test
run: c:\msys64\usr\bin\bash -l -c "cd $env:PWD && make ci-windows-bootstrap-test"
- name: Install
run: c:\msys64\usr\bin\bash -l -c "cd $env:PWD && make install"
- name: Artifact Idris2 from chez
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: windows-installed-bootstrapped-idris2-chez
path: ${{ env.IDRIS_PREFIX }}
nix-bootstrap-chez:
needs: [initialise, quick-check]
runs-on: ubuntu-latest
if: |
(!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: nix]')
|| contains(needs.initialise.outputs.commit_message, '[ci: chez]'))
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: cachix/install-nix-action@v18
- name: Test with nix
env:
NIX_CONFIG: "experimental-features = nix-command flakes"
run: nix build .#checks.x86_64-linux.idris2Tests -L
# RACKET
ubuntu-bootstrap-racket:
needs: [initialise, quick-check]
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: ubuntu]')
|| contains(needs.initialise.outputs.commit_message, '[ci: racket]')
env:
IDRIS2_CG: racket
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get install -y racket
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
- name: Make bootstrap folder readonly
run: chmod -R a-w bootstrap
- name: Build from bootstrap
run: make bootstrap-racket && make install
- name: Artifact Bootstrapped Idris2
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: ubuntu-installed-bootstrapped-idris2-racket
path: ~/.idris2/
######################################################################
# Self-hosting builds and testing
######################################################################
# CHEZ
ubuntu-self-host-chez:
needs: ubuntu-bootstrap-chez
runs-on: ubuntu-latest
env:
IDRIS2_CG: chez
SCHEME: scheme
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Idris2 Artifact
uses: actions/download-artifact@v4
with:
name: ubuntu-installed-bootstrapped-idris2-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Build self-hosted
run: make all IDRIS2_BOOT="idris2 -Werror" && make install
- name: Test self-hosted
run: make ci-ubuntu-test INTERACTIVE=''
macos-self-host-chez:
needs: macos-bootstrap-chez
runs-on: macos-latest
env:
SCHEME: chez
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Idris2 Artifact
uses: actions/download-artifact@v4
with:
name: macos-installed-bootstrapped-idris2-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
brew update
brew install --overwrite python@3.12
brew install chezscheme
brew install node
brew install coreutils
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Build self-hosted
run: make all IDRIS2_BOOT="idris2 -Werror" && make install
shell: bash
- name: Test self-hosted
run: make ci-macos-test INTERACTIVE=''
shell: bash
# RACKET
ubuntu-self-host-racket:
needs: ubuntu-bootstrap-racket
runs-on: ubuntu-latest
if: false
env:
IDRIS2_CG: racket
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Idris2 Artifact
uses: actions/download-artifact@v4
with:
name: ubuntu-installed-bootstrapped-idris2-racket
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get install -y racket
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Build self-hosted
run: make all IDRIS2_BOOT="idris2 -Werror" && make install
- name: Test self-hosted
run: make ci-ubuntu-test INTERACTIVE=''
ubuntu-self-host-previous-version:
needs: [initialise, quick-check]
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: ubuntu]')
|| contains(needs.initialise.outputs.commit_message, '[ci: libs]')
env:
IDRIS2_CG: chez
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Idris2 Artifact
uses: actions/download-artifact@v4
with:
name: ubuntu-installed-idris2-${{ env.IDRIS2_MINIMUM_COMPAT_VERSION }}-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Build self-hosted from previous version
run: make all IDRIS2_BOOT="idris2 -Werror" && make install
- name: Test self-hosted from previous version
run: make ci-ubuntu-test INTERACTIVE=''
- name: Artifact Idris2
uses: actions/upload-artifact@v4
with:
include-hidden-files: true
name: idris2-nightly-chez
path: ~/.idris2/
windows-self-host-racket:
needs: [initialise, windows-bootstrap-chez]
runs-on: windows-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: windows]')
|| contains(needs.initialise.outputs.commit_message, '[ci: racket]')
env:
IDRIS2_CG: racket
MSYSTEM: MINGW64
MSYS2_PATH_TYPE: inherit
CC: gcc
RACKET_RACO: raco
steps:
- name: Init
run: |
git config --global core.autocrlf false
echo "PWD=$(c:\msys64\usr\bin\cygpath -u $(pwd))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Checkout
uses: actions/checkout@v4
- name: Get Chez Scheme
run: |
git clone --depth 1 --branch v9.5.8a https://github.com/cisco/ChezScheme
c:\msys64\usr\bin\bash -l -c "pacman -S --noconfirm tar make mingw-w64-x86_64-gcc"
echo "PWD=$(c:\msys64\usr\bin\cygpath -u $(pwd))" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Configure and Build Chez Scheme
run: |
c:\msys64\usr\bin\bash -l -c "cd $env:PWD && cd ChezScheme && ./configure --threads && make"
- name: Set Path
run: |
$chez="$(pwd)\ChezScheme\ta6nt\bin\ta6nt"
$idris="$(pwd)\.idris2"
echo "$chez" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "$idris\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "IDRIS_PREFIX=$idris" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "PREFIX=$(c:\msys64\usr\bin\cygpath -u $idris)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Download Idris2 Artifact
uses: actions/download-artifact@v4
with:
name: windows-installed-bootstrapped-idris2-chez
path: ${{ env.IDRIS_PREFIX }}
- name: Install build dependencies
uses: Bogdanp/setup-racket@v1.11
with:
variant: 'CS'
version: 'stable'
distribution: 'full'
- name: Self host
run: |
c:\msys64\usr\bin\bash -l -c "cd $env:PWD && make"
# TODO: fix the broken tests!
# - name: Test
# run: c:\msys64\usr\bin\bash -l -c "cd $env:PWD && make ci-windows-test"
- name: Install
run: c:\msys64\usr\bin\bash -l -c "cd $env:PWD && make install"
######################################################################
# Ubuntu API
######################################################################
ubuntu-build-api:
needs: ubuntu-bootstrap-chez
runs-on: ubuntu-latest
env:
IDRIS2_CG: chez
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Idris2 Artifact
uses: actions/download-artifact@v4
with:
name: ubuntu-installed-bootstrapped-idris2-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Build API
run: make install-api
shell: bash
- name: Test API
run: cd tests/idris2/api/api001 && ./run "$HOME/.idris2/bin/idris2"
shell: bash
######################################################################
# Testing some libraries on Ubuntu and pack.
#
# We are particularly interested in libraries that are heavily using
# dependent types, that are prone to find bugs and regressions in the
# compiler.
######################################################################
######################################################################
# Test that we can build Collie
######################################################################
ub-test-collie:
needs: [initialise, ubuntu-self-host-previous-version]
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: libs]')
env:
IDRIS2_CG: chez
steps:
- name: Download Idris2 Artifact
uses: actions/download-artifact@v4
with:
name: idris2-nightly-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'ohad/collie'
- name: Build Collie
run: |
make
########################################################################
# Test that we can build Frex
########################################################################
ub-test-frex:
needs: [initialise, ubuntu-self-host-previous-version]
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: libs]')
env:
IDRIS2_CG: chez
steps:
- name: Download Idris2 Artifact
uses: actions/download-artifact@v4
with:
name: idris2-nightly-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'frex-project/idris-frex'
- name: Build Frex
run: |
make
make test
######################################################################
# Test that we can build Stefan Höck's elab-util and pack
######################################################################
# ELAB-UTIL
ub-test-elab-util:
needs: [initialise, ubuntu-self-host-previous-version]
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: libs]')
env:
IDRIS2_CG: chez
steps:
- name: Download Idris2 Artifact
uses: actions/download-artifact@v4
with:
name: idris2-nightly-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'stefan-hoeck/idris2-elab-util'
- name: Build idris2-elab-util
run: |
make all
# PACK
#
# N.B. instead of bootstrapping pack, we use the dockerimage where it is
# already, and then use pack to rebuild pack with this job's idris2 sources
ub-pack-test-pack:
needs: [initialise, ubuntu-self-host-previous-version]
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: libs]')
env:
IDRIS2_CG: chez
PACK_DIR: /root/.pack
strategy:
fail-fast: false
# N.B.:
container: ghcr.io/stefan-hoeck/idris2-pack:latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'stefan-hoeck/idris2-pack'
# by default, pack uses the main idris2 head, not the current job's one
- name: Toml setup
run: |
{ echo "[idris2]"
echo "url = \"https://github.com/${GITHUB_REPOSITORY}\""
echo "commit = \"latest:${GITHUB_REF_NAME}\""
echo "bootstrap = true"
} > pack.toml
- name: Build idris2-pack
run: |
git config --global --add safe.directory "${PWD}"
# only fetch to a new branch if we're not on main (otherwise, git complains)
if [[ $(git branch --show-current) != 'main' ]]
then git fetch "https://github.com/${GITHUB_REPOSITORY}" "${GITHUB_REF}:${GITHUB_REF_NAME}"
else git pull origin main
fi
# rebuild pack with the fetched Idris2
pack install pack
######################################################################
# Test that we can build the LSP
######################################################################
ub-pack-test-lsp:
needs: [initialise, ubuntu-self-host-previous-version]
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: libs]')
env:
IDRIS2_CG: chez
PACK_DIR: /root/.pack
# LSP is vastly easier to build using pack, so do that
container: ghcr.io/stefan-hoeck/idris2-pack:latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: 'idris-community/idris2-lsp'
- name: Toml setup
run: |
{ echo "[idris2]"
echo "url = \"https://github.com/${GITHUB_REPOSITORY}\""
echo "commit = \"latest:${GITHUB_REF_NAME}\""
echo "bootstrap = true"
} > pack.toml
# make sure pack is running the PR's Idris2 before building LSP
- name: Build pack with PR-Idris
run: |
git config --global --add safe.directory "${PWD}"
# only fetch to a new branch if we're not on main (otherwise, git complains)
if [[ $(git branch --show-current) != 'main' ]]
then git fetch "https://github.com/${GITHUB_REPOSITORY}" "${GITHUB_REF}:${GITHUB_REF_NAME}"
else git pull origin main
fi
pack install pack
- name: Build+install idris2-lsp
run: |
pack --no-prompt install-app idris2-lsp
######################################################################
# Test that we can use Katla to build html doc of the libs
######################################################################
ub-test-katla-and-html:
needs: [initialise, ubuntu-self-host-previous-version]
runs-on: ubuntu-latest
if: |
!contains(needs.initialise.outputs.commit_message, '[ci:')
|| contains(needs.initialise.outputs.commit_message, '[ci: html]')
env:
IDRIS2_CG: chez
steps:
- name: Initialise DEPLOY variable
run: |
if [[ '${{ github.ref }}' == 'refs/heads/main' ]]; then
echo "IDRIS2_DEPLOY=true" >> "$GITHUB_ENV"
fi
- name: Download Idris2 Artifact
uses: actions/download-artifact@v4
with:
name: idris2-nightly-chez
path: ~/.idris2/
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y chezscheme markdown
echo "$HOME/.idris2/bin" >> "$GITHUB_PATH"
chmod +x "$HOME/.idris2/bin/idris2" "$HOME/.idris2/bin/idris2_app/"*
- name: Checkout idris2
uses: actions/checkout@v4
- name: Build API
run: make install-api
shell: bash
- name: Checkout collie
uses: actions/checkout@v4
with:
repository: 'ohad/collie'
- name: Build and install Collie
run: |
make install
- name: Checkout idrall
uses: actions/checkout@v4
with:
repository: 'alexhumphreys/idrall'
- name: Build and install idrall
run: |
make install
- name: Checkout katla
uses: actions/checkout@v4
with:
repository: 'idris-community/katla'
- name: Build and install katla
run: |
make
mkdir -p "${HOME}"/.local/bin/
cp -r build/exec/* "${HOME}"/.local/bin/
echo "${HOME}/.local/bin" >> "$GITHUB_PATH"
- name: Checkout idris2
uses: actions/checkout@v4
- name: Build html doc & landing page
run: |
make -C libs/prelude/ install docs IDRIS2=idris2
make -C libs/base/ install docs IDRIS2=idris2
make -C libs/contrib/ install docs IDRIS2=idris2
make -C libs/network/ install docs IDRIS2=idris2
make -C libs/linear/ install docs IDRIS2=idris2
make -C libs/test/ install docs IDRIS2=idris2
make -C libs/papers/ install docs IDRIS2=idris2
cd .github/scripts
./katla.sh
cd -
cd www/
./katla.sh
cd -
cp -r www/html/* .github/scripts/html/
cp www/source/idris-logo-base.png .github/scripts/html/
- name: Deploy HTML
uses: JamesIves/github-pages-deploy-action@v4.4.3
if: ${{ success() && env.IDRIS2_DEPLOY }}
with:
branch: gh-pages
folder: .github/scripts/html/
git-config-name: Github Actions