2020-09-23 11:36:12 +02:00
|
|
|
name: next
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- next
|
|
|
|
|
|
|
|
env:
|
|
|
|
SHELLCHECK_VERSION: v0.7.1
|
2021-10-09 14:58:34 +02:00
|
|
|
SHELLCHECK_SHA256: 64f17152d96d7ec261ad3086ed42d18232fcb65148b44571b564d688269d36c8
|
2021-10-08 17:24:46 +02:00
|
|
|
NEWT_VERSION: 0.52.21
|
|
|
|
NEWT_SHA256: 265eb46b55d7eaeb887fca7a1d51fe115658882dfe148164b6c49fccac5abb31
|
2020-09-23 11:36:12 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
perform_tests:
|
|
|
|
name: Run tests on kas code
|
2022-12-13 14:56:14 +01:00
|
|
|
runs-on: ubuntu-20.04
|
2020-09-23 11:36:12 +02:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-12-13 14:56:14 +01:00
|
|
|
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
|
2020-09-23 11:36:12 +02:00
|
|
|
steps:
|
|
|
|
- name: Check out repo
|
2023-01-05 20:17:20 +01:00
|
|
|
uses: actions/checkout@v3
|
2020-09-23 11:36:12 +02:00
|
|
|
- name: Set up Python
|
2023-01-05 20:17:20 +01:00
|
|
|
uses: actions/setup-python@v4
|
2020-09-23 11:36:12 +02:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
architecture: x64
|
|
|
|
- name: Install Python dependencies of kas and tests
|
|
|
|
run: |
|
|
|
|
# install kas to have all kas dependencies:
|
|
|
|
pip install .
|
|
|
|
# checkcode dependencies:
|
|
|
|
pip install flake8 pycodestyle doc8 Pygments
|
|
|
|
# test dependencies:
|
|
|
|
pip install -U pytest
|
|
|
|
- name: Install recent shellcheck
|
|
|
|
run: |
|
|
|
|
wget -q https://github.com/koalaman/shellcheck/releases/download/$SHELLCHECK_VERSION/shellcheck-$SHELLCHECK_VERSION.linux.x86_64.tar.xz
|
2021-10-09 14:58:34 +02:00
|
|
|
echo "$SHELLCHECK_SHA256 shellcheck-$SHELLCHECK_VERSION.linux.x86_64.tar.xz" | sha256sum -c
|
2020-09-23 11:36:12 +02:00
|
|
|
tar -xJf shellcheck-$SHELLCHECK_VERSION.linux.x86_64.tar.xz
|
|
|
|
sudo cp shellcheck-$SHELLCHECK_VERSION/shellcheck /usr/local/bin/
|
2021-10-08 17:24:46 +02:00
|
|
|
- name: Install python-newt
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install libpopt-dev libslang2-dev
|
|
|
|
wget -q https://releases.pagure.org/newt/newt-$NEWT_VERSION.tar.gz
|
|
|
|
echo "$NEWT_SHA256 newt-$NEWT_VERSION.tar.gz" | sha256sum -c
|
|
|
|
tar -C /tmp -xzf newt-$NEWT_VERSION.tar.gz
|
|
|
|
cd /tmp/newt-$NEWT_VERSION
|
|
|
|
autoconf
|
|
|
|
./configure --with-python=python${{ matrix.python-version }}
|
|
|
|
make -j $(nproc)
|
|
|
|
sudo make install
|
|
|
|
ln -s /usr/local/lib/python${{ matrix.python-version }}/site-packages/_snack.so \
|
|
|
|
$(python3 -c 'import site; print(site.getsitepackages()[0])')/
|
|
|
|
ln -s /usr/local/lib/python${{ matrix.python-version }}/site-packages/snack.py \
|
|
|
|
$(python3 -c 'import site; print(site.getsitepackages()[0])')/
|
2020-09-23 11:36:12 +02:00
|
|
|
- name: Run tests
|
|
|
|
run: |
|
|
|
|
scripts/checkcode.sh .
|
2021-10-08 17:24:46 +02:00
|
|
|
TERM=xterm pytest
|
2020-09-23 11:36:12 +02:00
|
|
|
|
2022-01-11 19:30:30 +01:00
|
|
|
build_containers:
|
|
|
|
name: Build, test and deploy container images
|
2020-09-23 11:36:12 +02:00
|
|
|
needs: perform_tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out repo
|
2023-01-05 20:17:20 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-01-02 19:49:39 +01:00
|
|
|
- name: Set up QEMU
|
2023-01-13 18:11:00 +01:00
|
|
|
uses: docker/setup-qemu-action@v2
|
2021-01-02 19:49:39 +01:00
|
|
|
- name: Set up Docker Buildx
|
2023-01-13 18:11:00 +01:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2020-09-23 11:36:12 +02:00
|
|
|
- name: Login to ghcr.io
|
2023-01-13 18:11:00 +01:00
|
|
|
uses: docker/login-action@v2
|
2020-09-23 11:36:12 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ secrets.PACKAGE_DEPLOY_USER }}
|
|
|
|
password: ${{ secrets.PACKAGE_DEPLOY_TOKEN }}
|
|
|
|
- name: Build kas image
|
2023-01-13 18:11:00 +01:00
|
|
|
uses: docker/build-push-action@v3
|
2022-01-11 19:30:30 +01:00
|
|
|
with:
|
|
|
|
load: true
|
|
|
|
tags: ghcr.io/siemens/kas/kas:next
|
|
|
|
- name: Test kas image
|
|
|
|
run: |
|
|
|
|
cd image-tests/poky
|
|
|
|
KAS_IMAGE_VERSION=next ../../kas-container build kas.yml
|
|
|
|
- name: Complete build and deploy kas image
|
2023-01-13 18:11:00 +01:00
|
|
|
uses: docker/build-push-action@v3
|
2020-09-23 11:36:12 +02:00
|
|
|
with:
|
2021-01-02 19:49:39 +01:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2021-01-02 18:50:34 +01:00
|
|
|
tags: ghcr.io/siemens/kas/kas:next
|
2022-01-11 19:30:30 +01:00
|
|
|
push: true
|
2020-09-23 11:36:12 +02:00
|
|
|
- name: Build kas-isar image
|
2023-01-13 18:11:00 +01:00
|
|
|
uses: docker/build-push-action@v3
|
2022-01-11 19:30:30 +01:00
|
|
|
with:
|
2022-08-26 14:34:37 +02:00
|
|
|
target: kas-isar
|
2022-01-11 19:30:30 +01:00
|
|
|
load: true
|
|
|
|
tags: ghcr.io/siemens/kas/kas-isar:next
|
|
|
|
- name: Test kas-isar image
|
|
|
|
run: |
|
|
|
|
cd image-tests/isar
|
|
|
|
KAS_IMAGE_VERSION=next ../../kas-container build kas.yml
|
|
|
|
- name: Complete build and deploy kas-isar image
|
2023-01-13 18:11:00 +01:00
|
|
|
uses: docker/build-push-action@v3
|
2020-09-23 11:36:12 +02:00
|
|
|
with:
|
2022-08-26 14:34:37 +02:00
|
|
|
target: kas-isar
|
2021-01-02 19:49:39 +01:00
|
|
|
platforms: linux/amd64,linux/arm64
|
2021-01-02 18:50:34 +01:00
|
|
|
tags: ghcr.io/siemens/kas/kas-isar:next
|
2022-01-11 19:30:30 +01:00
|
|
|
push: true
|