Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
.github/test.yml: add job to test arm64 docker image
Browse files Browse the repository at this point in the history
Signed-off-by: Charles Oliveira <[email protected]>
  • Loading branch information
chaws committed Oct 6, 2023
1 parent 2167533 commit 2ebb524
Showing 1 changed file with 111 additions and 88 deletions.
199 changes: 111 additions & 88 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2ebb524

Please sign in to comment.