Files

170 lines
4.4 KiB
YAML

name: CI Tests
on:
push:
branches: [ master ]
pull_request:
merge_group:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
NIX_CONFIG: |
experimental-features = nix-command flakes
jobs:
flake-check:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- name: Linux (x86_64-linux)
runner: ubuntu-latest
system: x86_64-linux
- name: Linux (aarch64-linux)
runner: ubuntu-24.04-arm
system: aarch64-linux
- name: macOS (aarch64-darwin)
runner: macos-latest
system: aarch64-darwin
macos_target: "11.3"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v12
- name: Setup Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v5
with:
use-flakehub: false
- name: Run flake checks
env:
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos_target }}
run: |
nix flake check \
--system ${{ matrix.system }} \
--print-build-logs \
--show-trace
e2e:
name: E2E (x86_64-linux)
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v12
- name: Setup Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v5
with:
use-flakehub: false
- name: Setup Cachix
uses: cachix/cachix-action@v15
with:
name: nix-community
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
continue-on-error: true
- name: Build logoscore + lgpm
run: |
nix build --print-build-logs --out-link result-logoscore \
'github:logos-co/logos-logoscore-cli/7fa0d891aecb033c208c7ac326a3800019484f09'
nix build --print-build-logs --out-link result-lgpm \
'github:logos-co/logos-package-manager/8a6b72f28b1e73b6d753eaabe7eba13bf425f04e#cli'
echo "LOGOSCORE_BIN=$PWD/result-logoscore/bin/logoscore" >> "$GITHUB_ENV"
echo "LGPM_BIN=$PWD/result-lgpm/bin/lgpm" >> "$GITHUB_ENV"
- name: Run openmetrics e2e
run: nix run .#openmetrics-e2e
- name: Run standalone e2e
if: ${{ !cancelled() }}
run: nix run .#standalone-e2e
sanitizers:
name: Sanitizers (${{ matrix.sanitizer }})
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
sanitizer: [asan, tsan]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v12
- name: Setup Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v5
with:
use-flakehub: false
- name: Build + run tests under ${{ matrix.sanitizer }}
run: |
nix build \
".#unit-tests-${{ matrix.sanitizer }}" \
--system x86_64-linux \
--print-build-logs \
--show-trace
windows-wsl:
name: Windows (WSL x86_64-linux)
runs-on: windows-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Install Ubuntu (if missing)
shell: powershell
run: |
$distros = wsl -l -q
if (-not ($distros -match "Ubuntu")) {
wsl --install -d Ubuntu --no-launch
}
- name: Run CI inside WSL
shell: powershell
run: >
wsl -d Ubuntu bash -lc
"set -e;
sudo apt-get update;
sudo apt-get install -y curl git;
curl -fsSL https://install.determinate.systems/nix | sh -s -- install --no-confirm;
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh;
nix flake check --system x86_64-linux --print-build-logs --show-trace"