run complement against docker:dind
This commit is contained in:
parent
23cc6e7f12
commit
304f44a11b
3 changed files with 59 additions and 17 deletions
|
@ -43,15 +43,47 @@ env:
|
||||||
WEB_UPLOAD_SSH_USERNAME: ${{ secrets.WEB_UPLOAD_SSH_USERNAME }}
|
WEB_UPLOAD_SSH_USERNAME: ${{ secrets.WEB_UPLOAD_SSH_USERNAME }}
|
||||||
GH_REF_NAME: ${{ github.ref_name }}
|
GH_REF_NAME: ${{ github.ref_name }}
|
||||||
WEBSERVER_DIR_NAME: ${{ (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}-${{ github.sha }}
|
WEBSERVER_DIR_NAME: ${{ (github.head_ref != '' && format('merge-{0}-{1}', github.event.number, github.event.pull_request.user.login)) || github.ref_name }}-${{ github.sha }}
|
||||||
|
DOCKER_HOST: "tcp://docker:2375"
|
||||||
|
DOCKER_TLS_CERTDIR: ""
|
||||||
|
|
||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
dind-test:
|
||||||
|
name: dind-${{ matrix.runner }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
runner:
|
||||||
|
- jade
|
||||||
|
- tom
|
||||||
|
- ubuntu-22.04
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
|
services:
|
||||||
|
dind:
|
||||||
|
env:
|
||||||
|
DOCKER_HOST: unix:///var/run/dind.socket
|
||||||
|
DOCKER_TLS_CERTDIR: ""
|
||||||
|
image: docker:dind
|
||||||
|
options: >-
|
||||||
|
--tty
|
||||||
|
--restart always
|
||||||
|
steps:
|
||||||
|
- name: curl
|
||||||
|
run: |-
|
||||||
|
sleep 30
|
||||||
|
curl dind:2375 || true
|
||||||
tests:
|
tests:
|
||||||
name: Test
|
name: Test
|
||||||
runs-on: [tom, dind, 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:
|
||||||
network: host
|
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
volumes:
|
volumes:
|
||||||
- /nix/store:/nix/store
|
- /nix/store:/nix/store
|
||||||
|
@ -111,8 +143,8 @@ jobs:
|
||||||
- name: Nom
|
- name: Nom
|
||||||
if: ${{ env.ACT_EXEC }}
|
if: ${{ env.ACT_EXEC }}
|
||||||
run: |
|
run: |
|
||||||
echo "aaaa"
|
echo "Installing nix output monitor"
|
||||||
nix profile install nixpkgs#nix-output-monitor -v
|
nix profile install nixpkgs#nix-output-monitor -Lv
|
||||||
sudo cp $(which nom) /usr/bin/nom-nix
|
sudo cp $(which nom) /usr/bin/nom-nix
|
||||||
file $(which nom)
|
file $(which nom)
|
||||||
lsblk
|
lsblk
|
||||||
|
@ -127,7 +159,8 @@ jobs:
|
||||||
sudo cp $(which nix) /usr/bin/nom-or-nix
|
sudo cp $(which nix) /usr/bin/nom-or-nix
|
||||||
fi
|
fi
|
||||||
echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' > "$HOME/.direnvrc"
|
echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' > "$HOME/.direnvrc"
|
||||||
nix profile install -v --inputs-from . nixpkgs#direnv nixpkgs#nix-direnv nixpkgs#nodejs
|
nix profile install -v --inputs-from . nixpkgs#direnv nixpkgs#nix-direnv nixpkgs#nodejs nixpkgs#iproute2 nixpkgs#nettools nixpkgs#bind
|
||||||
|
ip a
|
||||||
direnv allow
|
direnv allow
|
||||||
|
|
||||||
if type nom &> /dev/null; then
|
if type nom &> /dev/null; then
|
||||||
|
@ -160,14 +193,23 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
direnv exec . engage > >(tee -a test_output.log)
|
direnv exec . engage > >(tee -a test_output.log)
|
||||||
|
|
||||||
|
- name: Build complement image
|
||||||
|
run: |
|
||||||
|
bin/nix-build-and-cache just .#complement
|
||||||
|
|
||||||
- name: Run Complement tests
|
- name: Run Complement tests
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
|
DOCKER_HOST: tcp://dind:2375
|
||||||
CARGO_PROFILE: "test"
|
CARGO_PROFILE: "test"
|
||||||
run: |
|
run: |
|
||||||
|
addr=$(ip -brief address show eth0 | awk '{print $3}' | awk -F/ '{print $1}')
|
||||||
|
export COMPLEMENT_HS_PORT_BINDING_IP=$(dig +short 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
|
cp -v -f result complement_oci_image.tar.gz
|
||||||
|
netstat -tnlp
|
||||||
|
|
||||||
- name: Upload Complement OCI image
|
- name: Upload Complement OCI image
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
@ -216,7 +258,7 @@ jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: [tom, nix, dind]
|
runs-on: [tom, nix]
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:js-latest
|
image: catthehacker/ubuntu:js-latest
|
||||||
volumes:
|
volumes:
|
||||||
|
|
20
flake.lock
generated
20
flake.lock
generated
|
@ -80,18 +80,18 @@
|
||||||
"complement": {
|
"complement": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741891349,
|
"lastModified": 1745202855,
|
||||||
"narHash": "sha256-YvrzOWcX7DH1drp5SGa+E/fc7wN3hqFtPbqPjZpOu1Q=",
|
"narHash": "sha256-Jr4625Gp5SzL1teCAEkIBiwIhWBZ3UlPXa//I+6Ncyk=",
|
||||||
"owner": "girlbossceo",
|
"ref": "morguldir/hs-ip",
|
||||||
"repo": "complement",
|
"rev": "d44afcb142a0d1e3d877e3f2e38115910f7f062c",
|
||||||
"rev": "e587b3df569cba411aeac7c20b6366d03c143745",
|
"revCount": 860,
|
||||||
"type": "github"
|
"type": "git",
|
||||||
|
"url": "https://forgejo.ellis.link/continuwuation/complement"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "girlbossceo",
|
"ref": "morguldir/hs-ip",
|
||||||
"ref": "main",
|
"type": "git",
|
||||||
"repo": "complement",
|
"url": "https://forgejo.ellis.link/continuwuation/complement"
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"crane": {
|
"crane": {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
attic.url = "github:zhaofengli/attic?ref=main";
|
attic.url = "github:zhaofengli/attic?ref=main";
|
||||||
cachix.url = "github:cachix/cachix?ref=master";
|
cachix.url = "github:cachix/cachix?ref=master";
|
||||||
complement = { url = "github:girlbossceo/complement?ref=main"; flake = false; };
|
complement = { url = "git+https://forgejo.ellis.link/continuwuation/complement?ref=morguldir/hs-ip"; flake = false; };
|
||||||
crane = { url = "github:ipetkov/crane?ref=master"; };
|
crane = { url = "github:ipetkov/crane?ref=master"; };
|
||||||
fenix = { url = "github:nix-community/fenix?ref=main"; inputs.nixpkgs.follows = "nixpkgs"; };
|
fenix = { url = "github:nix-community/fenix?ref=main"; inputs.nixpkgs.follows = "nixpkgs"; };
|
||||||
flake-compat = { url = "github:edolstra/flake-compat?ref=master"; flake = false; };
|
flake-compat = { url = "github:edolstra/flake-compat?ref=master"; flake = false; };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue