test nix build
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2s

This commit is contained in:
Arne Weiss
2024-05-26 16:33:15 +02:00
parent 0c47105040
commit f6ff3579b7
5 changed files with 64 additions and 0 deletions

View File

@@ -5,6 +5,8 @@ on: [push]
jobs:
Explore-Gitea-Actions:
runs-on: ubuntu-latest
container:
image: lnl7/nix:2.3.16
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
@@ -13,6 +15,8 @@ jobs:
uses: actions/checkout@v3
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: Build with Nix
run: nix build
- name: List files in the repository
run: |
ls ${{ gitea.workspace }}

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
result

23
default.nix Normal file
View File

@@ -0,0 +1,23 @@
{ stdenv, stress-ng, coreutils }:
stdenv.mkDerivation {
name = "cpu-intensive-task";
src = ./.;
buildInputs = [ stress-ng coreutils ];
buildPhase = ''
echo "Starting CPU intensive task..."
# Utilize all CPU cores for 2 minutes
stress-ng --cpu 0 --timeout 120s
echo "Task completed!"
'';
installPhase = ''
mkdir -p $out
echo "Task completed!" > $out/result.txt
'';
}

26
flake.lock generated Normal file
View File

@@ -0,0 +1,26 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1716733162,
"narHash": "sha256-nMR45AytYy7pLp4UEM8UAaHwg9yttMfhBKXEGbSUKfc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5997f570487284e8f6cb06a50ebfd33867e81a9f",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

10
flake.nix Normal file
View File

@@ -0,0 +1,10 @@
{
description = "A simple Nix flake to utilize all CPU cores for a few minutes";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
outputs = { self, nixpkgs }: {
packages.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.callPackage ./default.nix {};
};
}