ci: upload complement image to run complement in a separate step

This commit is contained in:
morguldir 2025-04-27 23:00:46 +02:00
parent 304f44a11b
commit 34c025097c
No known key found for this signature in database
GPG key ID: 5A6025D4F6E7A8A3

View file

@ -75,16 +75,8 @@ jobs:
tests: tests:
name: Test name: Test
runs-on: [tom, nix] runs-on: [tom, nix]
services:
dind:
image: docker:dind
options: >-
--privileged
env:
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: unix:///var/run/dind.socket
container: container:
image: catthehacker/ubuntu:act-latest image: catthehacker/ubuntu:rust-latest
volumes: volumes:
- /nix/store:/nix/store - /nix/store:/nix/store
- /nix/var/nix/db:/nix/var/nix/db - /nix/var/nix/db:/nix/var/nix/db
@ -196,6 +188,68 @@ jobs:
- name: Build complement image - name: Build complement image
run: | run: |
bin/nix-build-and-cache just .#complement bin/nix-build-and-cache just .#complement
cp -v -f result complement_oci_image.tar.gz
- name: Upload Complement OCI image
uses: https://data.forgejo.org/forgejo/upload-artifact@v4
env:
with:
name: complement_oci_image.tar.gz
path: complement_oci_image.tar.gz
if-no-files-found: error
compression-level: 0
complement:
name: complement
runs-on: [dind, nix]
needs: tests
services:
dind:
image: docker:dind
options: >-
--privileged
env:
DOCKER_TLS_CERTDIR: ""
DOCKER_HOST: unix:///var/run/dind.socket
container:
image: catthehacker/ubuntu:act-latest
volumes:
- /nix/store:/nix/store
- /nix/var/nix/db:/nix/var/nix/db
steps:
- name: Sync repository
uses: actions/checkout@v4
with:
persist-credentials: false
- uses: https://github.com/cachix/install-nix-action@v31.1.0
- name: Prepare build environment
shell: bash
run: |
echo $SHELL
df -h /nix/var/nix/db
du -had 1 /nix/
if ! type nom &> /dev/null; then
sudo cp $(which nix) /usr/bin/nom-or-nix
fi
echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' > "$HOME/.direnvrc"
nix profile install -v --inputs-from . nixpkgs#direnv nixpkgs#nix-direnv nixpkgs#nodejs nixpkgs#iproute2 nixpkgs#nettools nixpkgs#bind
ip a
direnv allow
if type nom &> /dev/null; then
nom develop .#all-features --command true
else
nix develop .#all-features --command true
fi
- name: Download artifacts
uses: https://data.forgejo.org/forgejo/download-artifact@v4
with:
pattern: "complement_oci_image.tar.gz"
- name: Run Complement tests - name: Run Complement tests
shell: bash shell: bash
@ -208,26 +262,17 @@ jobs:
export COMPLEMENT_HOSTNAME_RUNNING_COMPLEMENT=dind export COMPLEMENT_HOSTNAME_RUNNING_COMPLEMENT=dind
# the nix devshell sets $COMPLEMENT_SRC, so "/dev/null" is no-op # the nix devshell sets $COMPLEMENT_SRC, so "/dev/null" is no-op
direnv exec . bin/complement "/dev/null" complement_test_logs.jsonl complement_test_results.jsonl > >(tee -a test_output.log) direnv exec . bin/complement "/dev/null" complement_test_logs.jsonl complement_test_results.jsonl > >(tee -a test_output.log)
cp -v -f result complement_oci_image.tar.gz
netstat -tnlp netstat -tnlp
- name: Upload Complement OCI image
uses: actions/upload-artifact@v4
with:
name: complement_oci_image.tar.gz
path: complement_oci_image.tar.gz
if-no-files-found: error
compression-level: 0
- name: Upload Complement logs - name: Upload Complement logs
uses: actions/upload-artifact@v4 uses: https://data.forgejo.org/forgejo/upload-artifact@v4
with: with:
name: complement_test_logs.jsonl name: complement_test_logs.jsonl
path: complement_test_logs.jsonl path: complement_test_logs.jsonl
if-no-files-found: error if-no-files-found: error
- name: Upload Complement results - name: Upload Complement results
uses: actions/upload-artifact@v4 uses: https://data.forgejo.org/forgejo/upload-artifact@v4
with: with:
name: complement_test_results.jsonl name: complement_test_results.jsonl
path: complement_test_results.jsonl path: complement_test_results.jsonl