Skip to content

Commit 2bdad73

Browse files
authored
Merge pull request #269 from lae/feature/gha
Run Vagrant in CI
2 parents df9ec5b + bfb18e3 commit 2bdad73

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

.github/workflows/ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: CI
3+
4+
"on":
5+
pull_request: {}
6+
push:
7+
branches: ["main"]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
11+
cancel-in-progress: true
12+
13+
defaults:
14+
run:
15+
shell: bash
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
vagrant-deploy:
22+
runs-on: ubuntu-22.04
23+
steps:
24+
- uses: actions/checkout@v4
25+
- run: sudo apt install nfs-kernel-server
26+
- run: sudo pipx inject ansible-core jmespath netaddr
27+
- run: ansible-galaxy install geerlingguy.ntp
28+
- name: setup vagrant
29+
run: |
30+
# Copyright The containerd Authors
31+
#
32+
# Licensed under the Apache License, Version 2.0 (the "License");
33+
# you may not use this file except in compliance with the License.
34+
# You may obtain a copy of the License at
35+
#
36+
# http://www.apache.org/licenses/LICENSE-2.0
37+
#
38+
# Unless required by applicable law or agreed to in writing, software
39+
# distributed under the License is distributed on an "AS IS" BASIS,
40+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41+
# See the License for the specific language governing permissions and
42+
# limitations under the License.
43+
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
44+
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
45+
sudo sed -i 's/^# deb-src/deb-src/' /etc/apt/sources.list
46+
sudo apt-get update
47+
sudo apt-get install -y libvirt-daemon libvirt-daemon-system vagrant
48+
sudo systemctl enable --now libvirtd
49+
sudo usermod -aG libvirt ${USER}
50+
sudo apt-get build-dep -y vagrant ruby-libvirt
51+
sudo apt-get install -y --no-install-recommends libxslt-dev libxml2-dev libvirt-dev ruby-bundler ruby-dev zlib1g-dev
52+
vagrant plugin install vagrant-libvirt
53+
- run: >
54+
sudo -E -u ${USER}
55+
ANSIBLE_STDOUT_CALLBACK=debug
56+
ANSIBLE_DISPLAY_SKIPPED_HOSTS=no
57+
ANSIBLE_DISPLAY_OK_HOSTS=no
58+
DEBIAN_FRONTEND=noninteractive
59+
PATH=$PIPX_BIN_DIR:$PATH
60+
vagrant up --no-tty || true

.yamllint.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
yaml:
3+
rules:
4+
line-length:
5+
max: 120

0 commit comments

Comments
 (0)