Skip to content

Commit

Permalink
Enable podman tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasjackson committed Aug 4, 2023
1 parent 652e2cb commit f1f8224
Showing 1 changed file with 79 additions and 87 deletions.
166 changes: 79 additions & 87 deletions .github/workflows/build_and_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,97 +169,89 @@ jobs:
tile: ${{ github.job_id }}
description: "Functional tests for docker: ${{matrix.folder}}"

# functional_test_podman:
# name: Functional Test Podman
# runs-on: ubuntu-latest
# needs: functional_test_docker

# strategy:
# max-parallel: 2
# fail-fast: false
# matrix:
# folder: [
# './examples/container',
# './examples/build',
# './examples/docs',
# './examples/single_k3s_cluster',
# './examples/nomad',
# './examples/local_exec',
# ]
functional_test_podman:
name: Functional Test Podman
runs-on: ubuntu-latest

# steps:
# - name: Download-Binaries
# uses: actions/download-artifact@v2
# with:
# name: test_binary
# path: /usr/local/bin
#
# - name: Make binary executable
# run: |
# sudo chmod +x /usr/local/bin/shipyard
strategy:
max-parallel: 2
fail-fast: false
matrix:
folder: [
'./examples/container',
# './examples/build',
# './examples/docs',
# './examples/single_k3s_cluster',
# './examples/nomad',
# './examples/local_exec',
]

# - uses: actions/checkout@v2
steps:
- name: Download-Binaries
uses: actions/download-artifact@v2
with:
name: test_binary
path: /usr/local/bin

- name: Make binary executable
run: |
sudo chmod +x /usr/local/bin/jumppad
# - name: Setup Go version
# uses: actions/setup-go@v1
# with:
# go-version: 1.19
#
# - name: Install dependencies for Podman tests
# run: |
# sudo apt install -y libbtrfs-dev pkg-config libgpgme-dev libdevmapper-dev podman dnsmasq
#
# - name: Setup DNSMasq default nameserver resolution
# run: |
# echo "disable resovld listening on 53"
# sudo /bin/bash -c 'echo "DNSStubListener=no" >> /etc/systemd/resolved.conf'
# sudo /bin/bash -c 'echo "DNS=8.8.8.8" >> /etc/systemd/resolved.conf'
# sudo systemctl restart systemd-resolved.service

# echo "configure dnsmasq"
# sudo /bin/bash -c 'echo "server=8.8.8.8" >> /etc/dnsmasq.conf'
# sudo /bin/bash -c 'echo "server=1.1.1.1" >> /etc/dnsmasq.conf'
# sudo systemctl restart dnsmasq

# sudo /bin/bash -c 'echo "127.0.0.1 ubuntu" >> /etc/hosts'
#
# - name: Setup Podman sock
# run: |
# sudo sed '/^SocketMode=.*/a SocketGroup=docker' -i /lib/systemd/system/podman.socket
# sudo chmod +x /run/podman

# sudo systemctl enable podman.socket
# sudo systemctl enable podman.service
# sudo systemctl start podman.service
# sudo podman info
#
# - name: Setup Podman dnsname plugin
# run: |
# mkdir -p /usr/libexec/cni
# sudo cp /usr/local/bin/dnsname /usr/libexec/cni
#
# - name: Setup Podman registries for Docker.io
# run: |
# echo -e "[registries.search]\nregistries = ['docker.io']" | sudo tee /etc/containers/registries.conf

# - name: Run tests Podman
# uses: nick-invision/retry@v2
# with:
# timeout_seconds: 600
# max_attempts: 3
# retry_on: error
# command: |
# export DOCKER_HOST=unix:///run/podman/podman.sock
# shipyard check
# shipyard test ${{matrix.folder}}
- uses: actions/checkout@v2

# - name: Send status to Discord
# uses: sarisia/actions-status-discord@v1
# if: always()
# with:
# webhook: ${{ secrets.DISCORD_WEBHOOK }}
# tile: ${{ github.job_id }}
# description: "Functional tests for ${{matrix.folder}}"
- name: Setup Go version
uses: actions/setup-go@v1
with:
go-version: 1.19

- name: Install dependencies for Podman tests
run: |
sudo mkdir -p /etc/apt/keyrings
# Debian Testing/Bookworm
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Testing/Release.key \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Testing/ /" \
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
# Debian Unstable/Sid
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Unstable/Release.key \
| gpg --dearmor \
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Unstable/ /" \
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
# Install Podman
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install podman
# Start the podman sock
nohup podman system service -t 0 > ./podman.log &
sleep 10
chmod +x /run/podman
chmod 777 /run/podman/podman.sock
- name: Run tests
run: |
jumppad check
jumppad purge
jumppad test ${{matrix.folder}}
env:
DOCKER_HOST: unix:///run/podman/podman.sock

- name: Send status to Discord
uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
tile: ${{ github.job_id }}
description: "Functional tests for ${{matrix.folder}}"

build_dev:
name: Build Dev Version
Expand Down

0 comments on commit f1f8224

Please sign in to comment.