test nix build
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2s
This commit is contained in:
@@ -5,6 +5,8 @@ on: [push]
|
|||||||
jobs:
|
jobs:
|
||||||
Explore-Gitea-Actions:
|
Explore-Gitea-Actions:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: lnl7/nix:2.3.16
|
||||||
steps:
|
steps:
|
||||||
- run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
|
- 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!"
|
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
|
||||||
@@ -13,6 +15,8 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
- 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."
|
- 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
|
- name: List files in the repository
|
||||||
run: |
|
run: |
|
||||||
ls ${{ gitea.workspace }}
|
ls ${{ gitea.workspace }}
|
||||||
|
|||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
result
|
||||||
23
default.nix
Normal file
23
default.nix
Normal 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
26
flake.lock
generated
Normal 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
10
flake.nix
Normal 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 {};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user