-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (103 loc) · 3.07 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:
branches: "main"
pull_request:
branches: "*"
jobs:
dot_deno_version:
runs-on: ubuntu-22.04
outputs:
value: ${{ steps.dot_deno_version.outputs.value }}
steps:
- uses: actions/checkout@v4
- id: dot_deno_version
run: |
echo "value=$(cat .deno-version)" >> "${GITHUB_OUTPUT}"
make:
runs-on: "${{ matrix.os }}"
needs: dot_deno_version
name: "${{ matrix.os }}: make ${{ matrix.target }} w/ deno ${{ matrix.deno_version }}"
strategy:
fail-fast: false
matrix:
os:
- "ubuntu-20.04"
- "ubuntu-22.04"
- "macos-13"
- "macos-14"
target:
- "clean all"
- "test"
- "docker-test"
- "docker-output-test"
deno_version:
- "not installed"
- "1.0.0"
- "${{ needs.dot_deno_version.outputs.value }}"
- "^1"
exclude:
# don't run target "docker-output-test" with deno_version "not installed"
- deno_version: "not installed"
target: "docker-output-test"
# otherwise, run on linux
# deno 1.0.0 was never released for macos
- os: "macos-13"
deno_version: "1.0.0"
- os: "macos-14"
deno_version: "1.0.0"
# only run target "test" on macos
- os: "macos-13"
target: "clean all"
- os: "macos-13"
target: "docker-test"
- os: "macos-13"
target: "docker-output-test"
- os: "macos-14"
target: "clean all"
- os: "macos-14"
target: "docker-test"
- os: "macos-14"
target: "docker-output-test"
steps:
- id: needs_deno_installed
name: Check whether to install deno before
shell: bash
run: |
set -euo pipefail
IFS=$'\n\t'
if [[ "${{ matrix.deno_version }}" == "not installed" ]]; then
echo "value=false" >> "${GITHUB_OUTPUT}"
else
echo "value=true" >> "${GITHUB_OUTPUT}"
fi
- uses: actions/checkout@v4
- name: Delete any deno binaries on PATH
if: steps.needs_deno_installed.outputs.value == 'false'
shell: bash
run: |
set -euo pipefail
IFS=$'\n\t'
delete_next_deno() {
local deno_path
deno_path="$(command -v deno || :)"
if [[ -z "${deno_path}" ]]; then
return 1
fi
if ! [[ -x "${deno_path}" ]]; then
return 1
fi
echo "deleting ${deno_path}"
rm -f "${deno_path}"
}
while delete_next_deno; do
:
done
! deno --version
- name: Setup deno ${{ matrix.deno-version }}
if: steps.needs_deno_installed.outputs.value == 'true'
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.deno-version }}
- name: Run "make ${{ matrix.target }}"
run: make ${{ matrix.target }}