Skip to content

Tests

Tests #277

Workflow file for this run

name: Tests
on:
schedule:
- cron: "0 0 7 * *"
workflow_run:
workflows: [ Sanity checks ]
types: [ completed ]
branches: [ main ]
workflow_dispatch:
jobs:
deps:
strategy:
matrix:
distro: [ "alpine:latest", "ubuntu:latest", "debian:latest", "archlinux:latest" ]
arch: [ amd64, i386 ]
runs-on: ubuntu-latest
container:
image: ${{ matrix.distro }}
steps:
- name: Install essentials
run: |
if [ "${{ matrix.distro }}" = "alpine:latest" ]; then
apk add python3
elif [ "${{ matrix.distro }}" = "archlinux:latest" ]; then
pacman -Sy
pacman -S --noconfirm python
else
apt-get update
apt-get install --yes --no-install-recommends python3
fi
- name: Check out repository code
uses: actions/checkout@v4
- name: Install dependencies
run: ./openbsd deps --install --arch=${{ matrix.arch }}
base:
needs:
- deps
strategy:
matrix:
version: [ 7.3, 7.4, 7.5, 7.6 ]
arch: [ amd64, i386 ]
runs-on: ubuntu-latest
container:
image: alpine:latest
env:
OPENBSD_CACHE: /tmp/cache
WORKDIR: /${{github.job}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}
steps:
- name: Install essentials
run: apk add bash python3 tar
- name: Check out repository code
uses: actions/checkout@v4
- name: Install dependencies
run: ./openbsd deps --install --arch=${{ matrix.arch }}
- name: Cache OpenBSD files
id: cache-openbsd
uses: actions/cache@v4
with:
path: ${{ env.OPENBSD_CACHE }}
key: openbsd-${{ matrix.version }}-${{ matrix.arch }}-${{ github.job }}
restore-keys: |
openbsd-${{ matrix.version }}-${{ matrix.arch }}-${{ github.job }}
openbsd-${{ matrix.version }}-${{ matrix.arch }}
openbsd-${{ matrix.version }}
openbsd
- name: Run test
run: tests/base -v ${{ matrix.version }} -a ${{ matrix.arch }}
- name: Keep artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ github.job }}-${{ matrix.version }}-${{ matrix.arch }}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}
retention-days: 3
path: |
/${{github.job}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}/**/*
!/**/*.img
example:
needs:
- base
strategy:
matrix:
version: [ 7.6 ]
arch: [ amd64 ]
runs-on: ubuntu-latest
env:
OPENBSD_CACHE: /tmp/cache
WORKDIR: /${{github.job}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}
container:
image: alpine:latest
steps:
- name: Install essentials
run: apk add bash python3 tar wget
- name: Check out repository code
uses: actions/checkout@v4
- name: Install dependencies
run: ./openbsd deps --install --arch=${{ matrix.arch }}
- name: Cache OpenBSD files
id: cache-openbsd
uses: actions/cache@v4
with:
path: ${{ env.OPENBSD_CACHE }}
key: openbsd-${{ matrix.version }}-${{ matrix.arch }}-${{ github.job }}
restore-keys: |
openbsd-${{ matrix.version }}-${{ matrix.arch }}-${{ github.job }}
openbsd-${{ matrix.version }}-${{ matrix.arch }}
openbsd-${{ matrix.version }}
openbsd
- name: Run test
run: timeout 1800 tests/example -v ${{ matrix.version }} -a ${{ matrix.arch }}
- name: Keep artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ github.job }}-${{ matrix.version }}-${{ matrix.arch }}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}
retention-days: 3
path: |
/${{github.job}}-${{github.run_id}}-${{github.run_number}}-${{github.run_attempt}}/**/*
!/**/*.img