ci: add initial workflows

Signed-off-by: Christoph Heiss <christoph@c8h4.io>
This commit is contained in:
Christoph Heiss 2024-10-26 21:23:22 +02:00
parent c09668cda6
commit fc5dce95d1
Signed by: c8h4
GPG key ID: 73D5E7FDEE3DE49A
2 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,21 @@
---
name: flake
on:
push:
env:
NIX_CONFIG: 'experimental-features = nix-command flakes'
jobs:
build:
runs-on: nixos-unstable
steps:
- name: prepare nix container
run: nix-env -iA nixpkgs.nodejs
- name: checkout repository
uses: actions/checkout@v4
- name: run flake check
run: nix flake check -L

View file

@ -0,0 +1,37 @@
---
name: nightly build
on:
push:
branches:
- main
env:
NIX_CONFIG: 'experimental-features = nix-command flakes'
jobs:
build:
runs-on: nixos-unstable
steps:
- name: prepare nix container
run: nix-env -iA nixpkgs.nodejs
- name: checkout repository
uses: actions/checkout@v4
- name: run flake check
run: nix flake check -L
- name: build nightly binary
run: nix build .#tiny-raytracer
- name: upload binary
# v4 has a bug: https://github.com/go-gitea/gitea/issues/31354
# use v3 until it is fixed
uses: forgejo/upload-artifact@v3
with:
name: tiny-raytracer-nightly-${{ env.GITHUB_SHA }}
path: result/bin/tiny-raytracer
retention-days: 14
if-no-files-found: error
overwrite: true