Skip to content

tests

tests #1307

Workflow file for this run

name: tests
on:
push:
branches:
- "**"
tags-ignore:
- "*.*"
schedule:
- cron: "12 12 * * *"
jobs:
tests:
strategy:
matrix:
arch: ["amd64", "arm64"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: linux/${{ matrix.arch }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Download and start db containers
run: |
touch .env
make docker_setup_up
- name: Cache
uses: actions/cache@v4
id: cache
with:
path: |
var-cache-pip
var-cache-apt
var-lib-apt
key: ${{ runner.os }}-cache-${{ hashFiles('docker/Dockerfile') }}
- name: Inject cache into docker
uses: reproducible-containers/buildkit-cache-dance@v3.1.2
with:
cache-map: |
{
"var-cache-pip": "/var/cache/pip",
"var-cache-apt": "/var/cache/apt",
"var-lib-apt": "/var/lib/apt"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Build and cache images
uses: docker/build-push-action@v6
with:
file: docker/Dockerfile
context: .
target: tests
cache-from: type=gha
cache-to: type=gha,mode=max
push: false
tags: rafsaf/ogion:dev
load: true
platforms: linux/${{ matrix.arch }}
- name: Build image and run tests in container
env:
OGION_ARCH: ${{ matrix.arch }}
run: |
touch .env
make unit_tests