From 2ebb5241f3a3210bffd1c97edbbdc6c059e9019a Mon Sep 17 00:00:00 2001 From: Charles Oliveira Date: Thu, 5 Oct 2023 18:21:49 -0300 Subject: [PATCH] .github/test.yml: add job to test arm64 docker image Signed-off-by: Charles Oliveira --- .github/workflows/test.yml | 199 +++++++++++++++++++++---------------- 1 file changed, 111 insertions(+), 88 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3a2f0116..eef88d5e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,97 +4,120 @@ on: [push, pull_request] jobs: - lint: - name: Lint with flake8 and reuse - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 - with: - python-version: 3.9 - - name: Run Flake8 - run: | - python -m pip install flake8 - flake8 - - name: REUSE Compliance Check - uses: fsfe/reuse-action@v1 - - i18n: - name: Make sure localization messages compile - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 - with: - python-version: 3.9 - - name: Install dependencies - run: | - sudo apt-get install gettext - python -m pip install --upgrade pip - pip install -r requirements-dev.txt - pip freeze - - name: Compile messages - run: ./manage.py compilemessages +# lint: +# name: Lint with flake8 and reuse +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - uses: actions/setup-python@v1 +# with: +# python-version: 3.9 +# - name: Run Flake8 +# run: | +# python -m pip install flake8 +# flake8 +# - name: REUSE Compliance Check +# uses: fsfe/reuse-action@v1 +# +# i18n: +# name: Make sure localization messages compile +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v2 +# - uses: actions/setup-python@v1 +# with: +# python-version: 3.9 +# - name: Install dependencies +# run: | +# sudo apt-get install gettext +# python -m pip install --upgrade pip +# pip install -r requirements-dev.txt +# pip freeze +# - name: Compile messages +# run: ./manage.py compilemessages +# +# unittest: +# name: Unittest +# timeout-minutes: 15 +# strategy: +# matrix: +# python: [3.8, 3.9] +# database: [sqlite, postgres] +# runs-on: ubuntu-latest +# services: +# postgres: +# image: postgres:latest +# env: +# POSTGRES_DB: squad +# POSTGRES_PASSWORD: squad +# POSTGRES_USER: postgres +# TZ: UTC +# PGTZ: UTC +# ports: +# - 5432:5432 +# env: +# DATABASE: "ENGINE=django.db.backends.postgresql_psycopg2:NAME=squad:USER=postgres:PASSWORD=squad:HOST=127.0.0.1:PORT=5432" +# SQUAD_TOKEN: ${{ secrets.SQUAD_TOKEN }} +# steps: +# - name: Check out repository code +# uses: actions/checkout@v2 +# - uses: actions/setup-python@v1 +# with: +# python-version: ${{ matrix.python }} +# - name: Install Dependencies +# run: | +# sudo apt install -y bc chromium-browser software-properties-common nodejs npm +# npm install +# python -m pip install --upgrade pip +# pip install -r requirements-dev.txt +# pip install --no-binary :all: psycopg2==2.8.6 +# pip freeze +# - name: Run tests using unittest +# run: | +# if [ "${{ matrix.database }}" = "sqlite" ]; +# then +# export DATABASE= +# export SQUAD_EXCLUDE_TEST_TAGS=skip_sqlite +# fi +# ./scripts/test-ci +# env: +# TESTENV: ${{ matrix.database }}-python${{ matrix.python }} +# - name: Run tests using pytest +# if: ${{ matrix.database == 'postgres' }} +# run: ./scripts/pytest +# +# docker-test: +# name: Run tests in docker and build release image +# runs-on: ubuntu-latest +# steps: +# - name: Check out repository code +# uses: actions/checkout@v2 +# - name: Build docker image +# run: | +# git fetch --unshallow +# ./scripts/test-docker +# - name: Run tests within docker +# run: ./dev-docker ./manage.py test -v 3 - unittest: - name: Unittest - timeout-minutes: 15 - strategy: - matrix: - python: [3.8, 3.9] - database: [sqlite, postgres] - runs-on: ubuntu-latest - services: - postgres: - image: postgres:latest - env: - POSTGRES_DB: squad - POSTGRES_PASSWORD: squad - POSTGRES_USER: postgres - TZ: UTC - PGTZ: UTC - ports: - - 5432:5432 - env: - DATABASE: "ENGINE=django.db.backends.postgresql_psycopg2:NAME=squad:USER=postgres:PASSWORD=squad:HOST=127.0.0.1:PORT=5432" - SQUAD_TOKEN: ${{ secrets.SQUAD_TOKEN }} - steps: - - name: Check out repository code - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python }} - - name: Install Dependencies - run: | - sudo apt install -y bc chromium-browser software-properties-common nodejs npm - npm install - python -m pip install --upgrade pip - pip install -r requirements-dev.txt - pip install --no-binary :all: psycopg2==2.8.6 - pip freeze - - name: Run tests using unittest - run: | - if [ "${{ matrix.database }}" = "sqlite" ]; - then - export DATABASE= - export SQUAD_EXCLUDE_TEST_TAGS=skip_sqlite - fi - ./scripts/test-ci - env: - TESTENV: ${{ matrix.database }}-python${{ matrix.python }} - - name: Run tests using pytest - if: ${{ matrix.database == 'postgres' }} - run: ./scripts/pytest - - docker-test: - name: Run tests in docker and build release image + docker-arm64-test: + name: Run tests in docker arm64 runs-on: ubuntu-latest steps: - name: Check out repository code uses: actions/checkout@v2 - name: Build docker image - run: | - git fetch --unshallow - ./scripts/test-docker - - name: Run tests within docker - run: ./dev-docker ./manage.py test -v 3 + uses: pguyot/arm-runner-action@v2 + with: + base_image: raspios_lite_arm64:latest + cpu: cortex-a53 + commands: | + uname -m + sudo apt-get install -y git apt-transport-https ca-certificates curl gnupg lsb-release + curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker.gpg + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null + sudo apt-get update + sudo apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin -y + git fetch --unshallow + ./scripts/test-docker + - name: Run tests within docker arm64 + run: ./dev-docker ./manage.py test -v 3