tricu/.gitea/workflows/test-and-build.yml

67 lines
1.4 KiB
YAML
Raw Normal View History

2025-01-21 12:24:11 -06:00
name: Test and Build
on:
push:
branches:
- main
2025-01-21 12:35:13 -06:00
- feat/cicd
2025-01-21 12:24:11 -06:00
pull_request:
types:
- opened
- synchronize
jobs:
test:
container:
2025-01-21 12:33:55 -06:00
image: debian:bookworm-slim
2025-01-21 12:24:11 -06:00
steps:
2025-01-21 12:33:55 -06:00
- name: Install prereqs
run: |
apt-get update && apt-get install -y \
curl \
sudo \
xz-utils \
gnupg \
&& rm -rf /var/lib/apt/lists/*
- name: Install Nix
run: |
curl -L https://nixos.org/nix/install | sh
. /root/.nix-profile/etc/profile.d/nix.sh
2025-01-21 12:24:11 -06:00
- name: Checkout code
uses: actions/checkout@v3
2025-01-21 12:33:55 -06:00
- name: Enter development shell and run tests
2025-01-21 12:24:11 -06:00
run: |
2025-01-21 12:33:55 -06:00
. /root/.nix-profile/etc/profile.d/nix.sh
2025-01-21 12:24:11 -06:00
nix develop --command cabal test
build:
container:
2025-01-21 12:33:55 -06:00
image: debian:bookworm-slim
needs: test
2025-01-21 12:24:11 -06:00
steps:
2025-01-21 12:33:55 -06:00
- name: Install prereqs
run: |
apt-get update && apt-get install -y \
curl \
sudo \
xz-utils \
gnupg \
&& rm -rf /var/lib/apt/lists/*
- name: Install Nix
run: |
curl -L https://nixos.org/nix/install | sh
. /root/.nix-profile/etc/profile.d/nix.sh
2025-01-21 12:24:11 -06:00
- name: Checkout code
uses: actions/checkout@v3
- name: Build binary
run: |
2025-01-21 12:33:55 -06:00
. /root/.nix-profile/etc/profile.d/nix.sh
2025-01-21 12:24:11 -06:00
nix build
2025-01-21 12:33:55 -06:00
ls -l ./result/bin/tricu