-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (110 loc) · 5.38 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
vars:
runs-on: ubuntu-latest
outputs:
package: cene
steps:
- name: Initialize variables
run: "true"
test:
needs: vars
runs-on: ubuntu-latest
strategy:
matrix:
racket-variant: ["BC", "CS"]
racket-version: ["8.3", "stable", "current"]
racket-catalogs-id: ["pkgs"]
racket-catalogs: [""]
include:
# We build once against racksnaps (https://racksnaps.defn.io/)
# so that it's easier to track down working dependency
# versions. This is essentially our package-lock.json or
# Cargo.lock information.
#
- racket-variant: "CS"
racket-version: "8.3"
racket-catalogs-id: "racksnaps"
racket-catalogs: |
https://download.racket-lang.org/releases/8.3/catalog/,
https://racksnaps.defn.io/built-snapshots/2022/02/08/catalog/
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Racket '${{ matrix.racket-version }}'
uses: Bogdanp/setup-racket@v1.7
with:
architecture: x64
distribution: full
variant: ${{ matrix.racket-variant }}
version: ${{ matrix.racket-version }}
catalogs: ${{ matrix.racket-catalogs }}
# This is based on
# https://github.com/soegaard/sketching/blob/bc24517203d5cae9019ee18491bb076b7299bbef/.github/workflows/push.yml
# and we're using it so that it's possible to set the
# catalogs without getting a permission error.
dest: '"${HOME}/racketdist"'
sudo: never
# This is based on
# https://github.com/Bogdanp/setup-racket-cache-example
- name: Record the Racket version
run: racket --version | tee .racket-version
- name: Record the Racket catalog URLs
run: echo "$SCRIPT_RACKET_CATALOGS" | tee .racket-catalogs
env:
SCRIPT_RACKET_CATALOGS: ${{ matrix.racket-catalogs }}
- name: Obtain cached Racket packages, if available
uses: actions/cache@v2
with:
path: |
~/.cache/racket
~/.local/share/racket
key: "\
${{ runner.os }}-\
${{ hashFiles('.racket-version', '.racket-catalogs') }}"
# We uninstall the packages if they're already installed. This
# can happen if the GitHub Actions cache is already populated with
# them.
- name: Uninstall `${{ needs.vars.outputs.package }}`
run: raco pkg remove --no-docs --batch ${{ needs.vars.outputs.package }} || true
- name: Uninstall `${{ needs.vars.outputs.package }}-test`
run: raco pkg remove --no-docs --batch ${{ needs.vars.outputs.package }}-test || true
- name: Uninstall `${{ needs.vars.outputs.package }}-doc`
run: raco pkg remove --no-docs --batch ${{ needs.vars.outputs.package }}-doc || true
- name: Uninstall `${{ needs.vars.outputs.package }}-lib`
run: raco pkg remove --no-docs --batch ${{ needs.vars.outputs.package }}-lib || true
# We install each package directory as a linked package, and we
# automatically fetch all the dependencies. We don't build the
# docs yet; we'll do that later when we're recompiling the
# project to check its dependencies.
#
# The order in which we install these packages matters; if we
# install a package before one it depends on, the command will
# fetch a stale copy of the dependency from the Racket package
# index.
#
- name: Install `${{ matrix.package }}-lib` and its dependencies
run: raco pkg install --auto --no-docs --batch --link "./${{ needs.vars.outputs.package }}-lib/"
- name: Install `${{ needs.vars.outputs.package }}-doc` and its dependencies
run: raco pkg install --auto --no-docs --batch --link "./${{ needs.vars.outputs.package }}-doc/"
- name: Install `${{ needs.vars.outputs.package }}-test` and its dependencies
run: raco pkg install --auto --no-docs --batch --link "./${{ needs.vars.outputs.package }}-test/"
- name: Install `${{ needs.vars.outputs.package }}` and its dependencies
run: raco pkg install --auto --no-docs --batch --link "./${{ needs.vars.outputs.package }}/"
# We recompile the collection (the single collection which all
# these packages populate) and check that the package
# dependencies declared in each info.rkt are correct.
- name: Recompile to check dependencies, and build documentation
run: raco setup --check-pkg-deps --unused-pkg-deps "${{ needs.vars.outputs.package }}"
# We run tests according to the way the DrDr continuous testing
# system does. This imitates the settings used by the Racket
# package index at <https://pkgs.racket-lang.org/>.
- name: Test `${{ needs.vars.outputs.package }}-lib`
run: raco test --drdr --package "${{ needs.vars.outputs.package }}-lib"
- name: Test `${{ needs.vars.outputs.package }}-doc`
run: raco test --drdr --package "${{ needs.vars.outputs.package }}-doc"
- name: Test `${{ needs.vars.outputs.package }}-test`
run: raco test --drdr --package "${{ needs.vars.outputs.package }}-test"
- name: Test `${{ needs.vars.outputs.package }}`
run: raco test --drdr --package "${{ needs.vars.outputs.package }}"