ci: init
Some checks failed
Test openperf / checkout_repos (native, stream) (push) Failing after 1m54s
Some checks failed
Test openperf / checkout_repos (native, stream) (push) Failing after 1m54s
This commit is contained in:
parent
d4748ac579
commit
1bdfbeeca0
4 changed files with 143 additions and 1 deletions
46
.gitea/workflows/build-and-test.yml
Normal file
46
.gitea/workflows/build-and-test.yml
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
name: Test openperf
|
||||||
|
|
||||||
|
on: [push, pull_request, workflow_dispatch]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checkout_repos:
|
||||||
|
runs-on: nix
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: ["native"] # Define architectures here
|
||||||
|
test_name: ["stream"] # Define test names here
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout Main Repo (openperf)
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: openperf
|
||||||
|
|
||||||
|
- name: Checkout Abstract Machine Repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ssh-key: '${{ secrets.DEPLOY_KEY }}'
|
||||||
|
ssh-user: 'forgejo'
|
||||||
|
ssh-known-hosts: 'git.xinyang.life ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICctRGZWr5+pxPh+8ABY4kjC57khQzOpXNz3CPaEDZuO'
|
||||||
|
repository: openperf/abstract-machine
|
||||||
|
path: abstract-machine
|
||||||
|
|
||||||
|
- name: Checkout Nemu Repo
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ssh-key: '${{ secrets.DEPLOY_KEY }}'
|
||||||
|
ssh-user: 'forgejo'
|
||||||
|
ssh-known-hosts: 'git.xinyang.life ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICctRGZWr5+pxPh+8ABY4kjC57khQzOpXNz3CPaEDZuO'
|
||||||
|
repository: openperf/nemu
|
||||||
|
path: nemu
|
||||||
|
|
||||||
|
- name: Build and Run with Matrix
|
||||||
|
working-directory: openperf
|
||||||
|
env:
|
||||||
|
AM_HOME: "${{ github.workspace }}/abstract-machine"
|
||||||
|
NEMU_HOME: "${{ github.workspace }}/nemu"
|
||||||
|
run: |
|
||||||
|
ls -l
|
||||||
|
nix develop .#native --impure --command make ARCH=${{ matrix.arch }} ALL=${{ matrix.test_name }} run
|
||||||
|
|
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -16,4 +16,5 @@ _*
|
||||||
*~
|
*~
|
||||||
build/
|
build/
|
||||||
!.gitignore
|
!.gitignore
|
||||||
.vscode
|
.vscode
|
||||||
|
abstract-machine/
|
||||||
|
|
27
flake.lock
generated
Normal file
27
flake.lock
generated
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1729658218,
|
||||||
|
"narHash": "sha256-9Rg+AqLqvqqJniP/OQB3GtgXoAd8IlazsHp97va042Y=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "dfffb2e7a52d29a0ef8e21ec8a0f30487b227f1a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
68
flake.nix
Normal file
68
flake.nix
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
{ self, nixpkgs, ... }:
|
||||||
|
{
|
||||||
|
devShells.x86_64-linux =
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
||||||
|
crossSystem = {
|
||||||
|
config = "riscv32-none-none-elf";
|
||||||
|
gcc = {
|
||||||
|
abi = "ilp32";
|
||||||
|
arch = "rv32i";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
localSystem = "x86_64-linux";
|
||||||
|
rv32CrossPkgs = import nixpkgs {
|
||||||
|
inherit localSystem crossSystem;
|
||||||
|
};
|
||||||
|
rv32LLVMCrossPkgs = import nixpkgs {
|
||||||
|
inherit localSystem;
|
||||||
|
crossSystem = crossSystem // {
|
||||||
|
useLLVM = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
bareClangStdenv =
|
||||||
|
with rv32LLVMCrossPkgs;
|
||||||
|
overrideCC clangStdenv buildPackages.llvmPackages.clangNoLibc;
|
||||||
|
|
||||||
|
nemuDepsBuildBuild = with pkgs; [
|
||||||
|
gnumake
|
||||||
|
SDL2
|
||||||
|
pkg-config
|
||||||
|
bison
|
||||||
|
flex
|
||||||
|
ncurses
|
||||||
|
readline
|
||||||
|
libllvm
|
||||||
|
gcc
|
||||||
|
clang
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
|
nemu = rv32CrossPkgs.mkDerivation {
|
||||||
|
name = "openperf";
|
||||||
|
depsBuildBuild = nemuDepsBuildBuild;
|
||||||
|
};
|
||||||
|
|
||||||
|
nemu-clang = bareClangStdenv.mkDerivation {
|
||||||
|
name = "openperf";
|
||||||
|
depsBuildBuild = nemuDepsBuildBuild;
|
||||||
|
};
|
||||||
|
|
||||||
|
native = pkgs.clangStdenv.mkDerivation {
|
||||||
|
name = "openperf";
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
gnumake
|
||||||
|
# clang
|
||||||
|
SDL2
|
||||||
|
# (gcc.cc.overrideAttrs (finalAttrs: previousAttrs: { separateDebugInfo = true; }))
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue