From 76945975c2b721bea382b8b58a42735cdd3c6860 Mon Sep 17 00:00:00 2001 From: xinyangli Date: Tue, 13 Aug 2024 20:43:19 +0800 Subject: [PATCH] ci: add auto build ci --- .gitea/workflows/abstract-machine-build.yml | 27 +++++++++++ .gitea/workflows/build.yml | 24 +++++++++ .gitignore | 54 ++++++++++++++++----- 3 files changed, 92 insertions(+), 13 deletions(-) create mode 100644 .gitea/workflows/abstract-machine-build.yml create mode 100644 .gitea/workflows/build.yml diff --git a/.gitea/workflows/abstract-machine-build.yml b/.gitea/workflows/abstract-machine-build.yml new file mode 100644 index 0000000..3a4547c --- /dev/null +++ b/.gitea/workflows/abstract-machine-build.yml @@ -0,0 +1,27 @@ +name: Build abstract machine with nix +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + build-abstract-machine: + runs-on: nix + steps: + - uses: https://github.com/cachix/cachix-action@v14 + with: + name: ysyx + authToken: '${{ secrets.CACHIX_SIGNING_KEY }}' + - uses: actions/checkout@v4 + with: + submodules: true + - name: Build abstract-machine + run: | + nix build .?submodules=1#abstract-machine + - name: Build nemu + run: | + nix build .?submodules=1#nemu + diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..0f02bf1 --- /dev/null +++ b/.gitea/workflows/build.yml @@ -0,0 +1,24 @@ +name: Run CTests within npc +on: [push] + +jobs: + npc-test: + runs-on: nix + steps: + - uses: https://github.com/cachix/cachix-action@v14 + with: + name: ysyx + authToken: '${{ secrets.CACHIX_SIGNING_KEY }}' + - uses: actions/checkout@v4 + - name: Cache develop environment + id: cache-nix-develop + uses: actions/cache@v4 + with: + path: | + /nix/store + /nix/var/nix/db + key: nix-develop-${{ hashFiles('flake.*') }} + - name: Build am-kernels + run: | + nix build .#{am-kernels} + nix build .#rv32Cross.{am-kernels-nemu, am-kernels-npc} diff --git a/.gitignore b/.gitignore index fe30a49..fa429be 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,43 @@ -!*/ -!*.h -!*.c -!*.cc -!*.S -!Makefile -!README -!README.md -!LICENSE -.* -_* -*~ build/ -!.gitignore out/ +.cache/ +.envrc +.vscode/ +# Created by https://www.toptal.com/developers/gitignore/api/c++ +# Edit at https://www.toptal.com/developers/gitignore?templates=c++ + +### C++ ### +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# End of https://www.toptal.com/developers/gitignore/api/c++