Skip to content

feat: Support Flatcar OS #337

feat: Support Flatcar OS

feat: Support Flatcar OS #337

Workflow file for this run

name: test
on:
pull_request:
paths-ignore:
- "docs/**"
- README.md
jobs:
build:
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- runs-on: ubuntu-20.04
python-version: "3.6"
- runs-on: ubuntu-latest
python-version: "3.7"
- runs-on: ubuntu-latest
python-version: "3.8"
- runs-on: ubuntu-latest
python-version: "3.9"
- runs-on: ubuntu-latest
python-version: "3.10"
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Install Poetry
run: make poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
cache: poetry
python-version: ${{ matrix.python-version }}
- name: Build package
run: make build
install:
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- runs-on: ubuntu-20.04
openstack-version: yoga
python-version: "3.6"
- runs-on: ubuntu-latest
python-version: "3.8"
openstack-version: zed
- runs-on: ubuntu-latest
python-version: "3.8"
openstack-version: "2023.1"
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Install Poetry
run: make poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
cache: poetry
python-version: ${{ matrix.python-version }}
- name: Build package
run: make build
- name: Install package using constraints
run: pip install --constraint https://releases.openstack.org/constraints/upper/${{ matrix.openstack-version }} ./dist/*.whl
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: pipx install flake8
- uses: suo/flake8-github-action@releases/v1
with:
checkName: flake8
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
isort:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: isort/isort-action@master
unit:
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
include:
- runs-on: ubuntu-20.04
python-version: "3.6"
- runs-on: ubuntu-latest
python-version: "3.7"
- runs-on: ubuntu-latest
python-version: "3.8"
- runs-on: ubuntu-latest
python-version: "3.9"
- runs-on: ubuntu-latest
python-version: "3.10"
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Install Poetry
run: make poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
cache: poetry
python-version: ${{ matrix.python-version }}
- name: Run unit tests
run: make unit-tests
build-images:
runs-on: ubuntu-latest-4-cores
if: contains(github.event.pull_request.body, '/build-new-image')
strategy:
fail-fast: false
matrix:
os:
- ubuntu-2204
- flatcar
kube:
- v1.24.16
- v1.25.12
- v1.26.7
- v1.27.4
concurrency:
group: build-images-${{ github.ref }}-${{ matrix.kube }}-${{ matrix.os }}
cancel-in-progress: true
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Install Cluster API driver for Magnum
run: |
pip install -U setuptools pip
$HOME/.local/bin/pip3 install -e .
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Build image
timeout-minutes: 30
run: |
magnum-cluster-api-image-builder \
--operating-system ${{ matrix.os }} \
--version ${{ matrix.kube }}
env:
PACKER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload built image
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-kube-${{ matrix.kube }}.qcow2
path: ${{ matrix.os }}-kube-${{ matrix.kube }}.qcow2
functional:
runs-on: ubuntu-latest-16-cores
strategy:
fail-fast: false
matrix:
os:
# - ubuntu-2204
- flatcar
kube:
# - v1.24.16
# - v1.25.12
# - v1.26.7
- v1.27.4
concurrency:
group: functional-${{ github.ref }}-${{ matrix.kube }}-${{ matrix.os }}
cancel-in-progress: true
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Clean-up node
run: sudo apt-get purge -y postgresql* mysql-*
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Install Magnum with Cluster API
run: ./hack/stack.sh
- name: Setup "tmate" session
uses: mxschmitt/action-tmate@v3
- name: Wait for images
if: contains(github.event.pull_request.body, '/build-new-image')
uses: lewagon/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: "build-images (${{ matrix.os }}, ${{ matrix.kube }})"
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- name: Download built image
if: contains(github.event.pull_request.body, '/build-new-image')
uses: actions/download-artifact@v3
with:
name: ${{ matrix.os }}-kube-${{ matrix.kube }}.qcow2
- name: Run functional tests
run: |
./hack/run-functional-tests.sh
env:
BUILD_NEW_IMAGE: "${{ contains(github.event.pull_request.body, '/build-new-image') }}"
OS: "${{ matrix.os }}"
KUBE_TAG: "${{ matrix.kube }}"
NODE_COUNT: 2
- name: Upload Sonobuoy results
uses: actions/upload-artifact@v3
if: always()
continue-on-error: true
with:
name: "sonobuoy-results-${{ matrix.kube }}"
path: sonobuoy-results.tar.gz