Skip to content

Commit

Permalink
Merge pull request #269 from lae/feature/gha
Browse files Browse the repository at this point in the history
Run Vagrant in CI
  • Loading branch information
lae authored Sep 13, 2024
2 parents df9ec5b + bfb18e3 commit 2bdad73
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
name: CI

"on":
pull_request: {}
push:
branches: ["main"]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

defaults:
run:
shell: bash

permissions:
contents: read

jobs:
vagrant-deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- run: sudo apt install nfs-kernel-server
- run: sudo pipx inject ansible-core jmespath netaddr
- run: ansible-galaxy install geerlingguy.ntp
- name: setup vagrant
run: |
# Copyright The containerd Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
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
sudo sed -i 's/^# deb-src/deb-src/' /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y libvirt-daemon libvirt-daemon-system vagrant
sudo systemctl enable --now libvirtd
sudo usermod -aG libvirt ${USER}
sudo apt-get build-dep -y vagrant ruby-libvirt
sudo apt-get install -y --no-install-recommends libxslt-dev libxml2-dev libvirt-dev ruby-bundler ruby-dev zlib1g-dev
vagrant plugin install vagrant-libvirt
- run: >
sudo -E -u ${USER}
ANSIBLE_STDOUT_CALLBACK=debug
ANSIBLE_DISPLAY_SKIPPED_HOSTS=no
ANSIBLE_DISPLAY_OK_HOSTS=no
DEBIAN_FRONTEND=noninteractive
PATH=$PIPX_BIN_DIR:$PATH
vagrant up --no-tty || true
5 changes: 5 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
yaml:
rules:
line-length:
max: 120

0 comments on commit 2bdad73

Please sign in to comment.