Fix containerd setup #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: | |
- '**' | |
env: | |
DOCKER_IMAGE: ghcr.io/${{ github.repository }} | |
jobs: | |
pylint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
#TODO: add annotations | |
#- uses: cclauss/[email protected] | |
- name: Install dependencies | |
run: | | |
pip install pylint | |
- name: Analysing the code with pylint | |
run: | | |
pylint `ls -R|grep .py$|xargs` | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildk | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ github.token }} | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: "${{ env.DOCKER_IMAGE }}:${{ github.sha }}" | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
test: | |
needs: build | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
OS=xUbuntu_20.04 | |
CRIO_VERSION=1.23 | |
KUBIC_REPO=https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable | |
sudo tee /etc/apt/sources.list.d/kubic-libcontainers.list <<< "deb $KUBIC_REPO/$OS/ /" | |
sudo tee -a /etc/apt/sources.list.d/kubic-libcontainers.list <<< "deb $KUBIC_REPO:/cri-o:/$CRIO_VERSION/$OS/ /" | |
curl -L $KUBIC_REPO/$OS/Release.key | sudo apt-key add - | |
curl -L $KUBIC_REPO:/cri-o:/$CRIO_VERSION/$OS/Release.key | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get -y install cri-o cri-o-runc cri-tools hardlink | |
# Also need skopeo ; but it is already installed | |
bash <(curl -s https://raw.githubusercontent.com/pgrange/bash_unit/master/install.sh) | |
# Start cri-o service | |
sudo systemctl start crio | |
# Fix broken containerd setup | |
sudo containerd config default | sudo tee /etc/containerd/config.toml | |
sudo systemctl restart containerd | |
# TODO: cache the installed image? | |
- name: Downgrade Oras to 0.12.0 | |
run: | | |
curl -LO https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_amd64.tar.gz | |
tar -zxf oras_${ORAS_VERSION}_*.tar.gz -C /usr/local/bin/ | |
rm -rf oras_${ORAS_VERSION}_*.tar.gz | |
env: | |
ORAS_VERSION: 0.12.0 | |
- name: Unit testing with bash_unit | |
run: | | |
export IMAGE="${{ env.DOCKER_IMAGE }}:${{ github.sha }}" | |
sudo FORCE_COLOR=true ./bash_unit test.sh | |
# TODO: parse individual tests results (in TAP format) | |
# - uses: dorny/test-reporter@v1 | |
# if: success() || failure() |