Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration Tests CI #40

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
7f5acd7
Add basic nix infrastructure
ThoFrank Dec 16, 2024
53eb373
Try to run pytest
ThoFrank Dec 16, 2024
2ca11ba
Add integration test gh action
ThoFrank Dec 17, 2024
bf39201
Add pytest ci posix target
ThoFrank Dec 18, 2024
29d7697
package udstool
ThoFrank Dec 18, 2024
934abff
git ignore .nixos-test-history
ThoFrank Dec 18, 2024
bdb2149
refactor and add devshell
ThoFrank Dec 18, 2024
2330167
increase posix ci timeouts
ThoFrank Dec 18, 2024
712eaad
add nix build for s32k148
ThoFrank Dec 19, 2024
6c1a55a
fix shell prompt to make udstool test work
ThoFrank Dec 19, 2024
1dd4d77
Add pytest debug output
ThoFrank Dec 19, 2024
66a950a
set boot time out crazy high
ThoFrank Dec 19, 2024
33019c5
Add error when running non-kvm vm
ThoFrank Dec 19, 2024
c0f10ed
give udstool more time to run
ThoFrank Dec 19, 2024
210d26c
fix flaky test_console_restart test
ThoFrank Dec 19, 2024
82e3c16
Clean up nix files and reformat
ThoFrank Dec 20, 2024
653db22
Revert "Add pytest debug output"
ThoFrank Dec 20, 2024
c10c261
Add nix README
ThoFrank Dec 20, 2024
b99e900
Fix up github actions
ThoFrank Dec 20, 2024
a567173
Re-enabble debug output
ThoFrank Jan 7, 2025
9cee256
Disable hardening on referenceApp
ThoFrank Jan 8, 2025
4e16c63
flake.lock: Update
ThoFrank Jan 8, 2025
ee3af77
enable it on push
ThoFrank Jan 10, 2025
4df86b0
ssh into gh action
ThoFrank Jan 10, 2025
c2313dc
maybe without hello
ThoFrank Jan 10, 2025
50db92f
reenable ssh
ThoFrank Jan 10, 2025
f145cee
change putByteToStdout implementation to putc
ThoFrank Jan 10, 2025
301f2a9
make flake macos compatible
ThoFrank Jan 15, 2025
33acfb4
switch to mac runner
ThoFrank Jan 15, 2025
f247101
switch to intel based mac runner as m1/m2 doesn't support nested virt…
ThoFrank Jan 15, 2025
968d000
print nix version
ThoFrank Jan 15, 2025
75de2c0
Hacked in linux-builder
ThoFrank Jan 15, 2025
b973a4f
undo debug shenanigans
ThoFrank Jan 15, 2025
48f3bf6
Fix some integration tests on nix ci
ThoFrank Jan 16, 2025
785cd07
Add doc coments to gh integration test workflow
ThoFrank Jan 16, 2025
7684a49
increase stat command tries
ThoFrank Jan 16, 2025
5559b64
format nix files
ThoFrank Jan 16, 2025
3e07a89
fix kernel panic
ThoFrank Jan 16, 2025
3619908
reformat
ThoFrank Jan 16, 2025
ad7923e
restrict NIX_BUILD_CORES
ThoFrank Jan 20, 2025
ba5b03d
allow non 0 cpu usage
ThoFrank Jan 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,22 @@ jobs:
treefmt:
runs-on: ubuntu-latest
steps:
- name: Create user program directory
run: |
mkdir -p $HOME/.local/bin
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- uses: actions/checkout@v4

- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Install treefmt
run: |
curl -L https://github.com/numtide/treefmt/releases/download/v2.1.0/treefmt_2.1.0_linux_amd64.tar.gz -o treefmt.tar.gz
tar -xvzf treefmt.tar.gz
install -m 755 treefmt $HOME/.local/bin
rm LICENSE README.md treefmt treefmt.tar.gz
run: nix profile install .#treefmt

- name: Install clang-format
run: |
curl -L https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-32d3ac78/clang-format-17_linux-amd64 -o clang-format
install -m 755 clang-format $HOME/.local/bin
rm clang-format
- name: Install nixfmt
run: nix profile install .#nixfmt

- uses: actions/setup-python@v5
- name: Install clang-format
run: nix profile install .#clang-tools

- name: Install cmake-format
run: |
pip install cmakelang

- uses: actions/checkout@v4
run: nix profile install .#cmake-format

- name: Check code format
run: |
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Integration Tests

on: [ merge_group, pull_request, push ]

env:
NIX_BUILD_CORES: 2

jobs:
integration-test:
# The integration tests run on macos because the referenceApp freezes on a nested vm on linux
# nested virtualization is only supported on intel based macs or M3 and later
runs-on: macos-13
steps:
- uses: actions/checkout@v4

# Install nix with a linux-builder
# This is required to build the referenceApp and the VM containing the tests
- run: |
cat << EOF | sudo tee /etc/ssh/ssh_config.d/100-linux-builder.conf
Host linux-builder
Hostname localhost
HostKeyAlias linux-builder
Port 31022
EOF
- uses: DeterminateSystems/nix-installer-action@main
with:
source-tag: v0.32.3 # https://github.com/DeterminateSystems/nix-installer-action/issues/133
extra-conf: |
system-features = apple-virt benchmark big-parallel nixos-test
builders = ssh-ng://builder@linux-builder x86_64-linux /etc/nix/builder_ed25519 4 - - - c3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUpCV2N4Yi9CbGFxdDFhdU90RStGOFFVV3JVb3RpQzVxQkorVXVFV2RWQ2Igcm9vdEBuaXhvcwo=
builders-use-substitutes = true

- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: JarvusInnovations/background-action@v1
name: Start linux-builder
with:
run: nix run nixpkgs#darwin.linux-builder
wait-on: "tcp:localhost:31022"
wait-for: 5m

- name: Run Integration Tests in VM
run: nix flake check --print-build-logs .
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ venv
.project
.envrc
.DS_Store
*.egg-info
*.egg-info
.nixos-test-history
5 changes: 5 additions & 0 deletions .treefmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ excludes = [
"*.yml",
"LICENSE",
"admin/cmake/CodeCoverage.cmake",
"flake.lock",
"tools/clang-format-wrapper",
]

Expand All @@ -41,3 +42,7 @@ includes = [ "*.c", "*.cc", "*.cpp", "*.h", ".hh", "*.hpp" ]
command = "cmake-format"
options = [ "-i" ]
includes = [ "**/CMakeLists.txt", "*.cmake" ]

[formatter.nixfmt]
command = "nixfmt"
includes = [ "*.nix" ]
243 changes: 243 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading