forked from groonga/groonga
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (136 loc) · 4.43 KB
/
setup.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
name: Setup
on:
push:
paths:
- '**/*.cmake'
- '**/*.cmake.in'
- '**/CMakeLists.txt'
- '.github/workflows/setup.yml'
- 'Vagrantfile'
- 'build.sh'
- 'cmake/**'
- 'include/**/*.h'
- 'include/**/*.h.in'
- 'include/**/*.hpp'
- 'lib/**/*.c'
- 'lib/**/*.cpp'
- 'lib/**/*.h'
- 'lib/**/*.hpp'
- 'lib/**/*.rb'
- 'plugins/**/*.c'
- 'plugins/**/*.cpp'
- 'plugins/**/*.h'
- 'plugins/**/*.rb'
- 'setup.sh'
- 'src/**/*.c'
- 'src/**/*.h'
- 'test/command/**'
- 'test/command_line/**'
- 'test/mruby/**'
- 'test/mruby/**'
- 'vendor/mruby/**'
pull_request:
paths:
- '**/*.cmake'
- '**/*.cmake.in'
- '**/CMakeLists.txt'
- '.github/workflows/setup.yml'
- 'Vagrantfile'
- 'build.sh'
- 'include/**/*.h'
- 'include/**/*.h.in'
- 'include/**/*.hpp'
- 'lib/**/*.c'
- 'lib/**/*.cpp'
- 'lib/**/*.h'
- 'lib/**/*.rb'
- 'lib/**/*.rb'
- 'plugins/**/*.c'
- 'plugins/**/*.cpp'
- 'plugins/**/*.h'
- 'plugins/**/*.rb'
- 'setup.sh'
- 'src/**/*.c'
- 'src/**/*.h'
- 'test/command/**'
- 'test/command_line/**'
- 'test/mruby/**'
- 'test/mruby/**'
- 'vendor/mruby/**'
concurrency:
group: ${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
linux:
name: Linux
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
image:
- "images:debian/12"
- "images:ubuntu/22.04"
- "images:ubuntu/24.04"
- "images:almalinux/8"
- "images:almalinux/9"
- "images:amazonlinux/2023"
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Incus
run: |
# We can use the official Ubuntu APT repository when
# ubuntu-latest is Ubuntu 24.04.
sudo curl -fsSL https://pkgs.zabbly.com/key.asc -o /etc/apt/keyrings/zabbly.asc
cat <<SOURCES | sudo tee /etc/apt/sources.list.d/zabbly-incus-stable.sources
Enabled: yes
Types: deb
URIs: https://pkgs.zabbly.com/incus/stable
Suites: $(. /etc/os-release && echo ${VERSION_CODENAME})
Components: main
Architectures: $(dpkg --print-architecture)
Signed-By: /etc/apt/keyrings/zabbly.asc
SOURCES
sudo apt update
sudo apt install -y -V incus
- name: Allow egress network traffic flows for Incus
# https://linuxcontainers.org/incus/docs/main/howto/network_bridge_firewalld/#prevent-connectivity-issues-with-incus-and-docker
run: |
sudo iptables -I DOCKER-USER -i incusbr0 -j ACCEPT
sudo iptables -I DOCKER-USER -o incusbr0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- name: Setup
run: |
set -x
sudo incus admin init --auto
sudo incus launch --quiet ${{ matrix.image }} target
sudo incus config device add target host disk source=$PWD path=/host
# Ideally, we would use systemctl is-system-running --wait to ensure all services are fully operational.
# However, this option doesn't work in AlmaLinux 8 and results in an error.
# As a workaround, we introduced a 10-second sleep delay to allow network services time to stabilize,
# preventing DNS resolution errors when attempting to dnf install command.
# ref: https://discuss.linuxcontainers.org/t/network-issue-with-almalinux-8-9-on-github-actions-using-incus/20046
sleep 10
sudo incus exec target -- /host/setup.sh
sudo incus exec target -- /host/build.sh /host /tmp/build /tmp/local
sudo incus stop target
sudo incus delete target
macos:
name: macOS
runs-on: macos-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup
run: |
# Workaround. pkg-config formula is deprecated but still
# installed in GitHub Actions runner. We can remove this
# when GitHub Actions runner doesn't include pkg-config
# formula by default.
brew uninstall pkg-config || :
brew uninstall [email protected] || :
./setup.sh
./build.sh ./ /tmp/build /tmp/local