-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (65 loc) · 2.01 KB
/
basic.yml
File metadata and controls
74 lines (65 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: "basic.yml"
on:
pull_request:
types:
- opened
- reopened
- synchronize
workflow_dispatch:
inputs:
debug_enabled:
type: "boolean"
description: "Run the build with tmate debugging enabled"
merge_group:
push:
branches:
- "main"
concurrency:
group: "${{ github.workflow }}:${{ github.ref }}"
cancel-in-progress: true
jobs:
build:
name: "build"
runs-on:
- "lab"
timeout-minutes: 300
permissions:
issues: "none"
pull-requests: "none"
packages: "write"
contents: "read"
id-token: "write"
steps:
- name: "log KUBE_NODE"
run: |
echo "$KUBE_NODE"
- uses: "actions/checkout@v5"
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: "install nix"
uses: "cachix/install-nix-action@v31"
- run: |
sudo chown -R "$(id -u):$(id -g)" /nix
- name: "login to ghcr.io"
uses: "docker/login-action@v3"
with:
registry: "ghcr.io"
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- uses: "dtolnay/rust-toolchain@stable"
- name: "build and test"
run: |
nix-channel --add https://nixos.org/channels/nixos-unstable nixpkgs
nix-channel --update
nix build -f default.nix testn.container
docker load < ./result
docker build --tag ghcr.io/githedgehog/testn/n-vm:v0.0.9 .
docker run --privileged --rm busybox:latest sh -c "echo 1024 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages && cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages"
cargo test --package=n-vm
docker push ghcr.io/githedgehog/testn/n-vm:v0.0.9
- name: "Setup tmate session for debug"
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: "mxschmitt/action-tmate@v3"
timeout-minutes: 60
with:
limit-access-to-actor: true