From 7c1bfc97c49ee2086f171cd316109749a8c21e9a Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 3 Sep 2025 08:18:56 -0700 Subject: [PATCH] setup github action for building --- .github/workflows/central-controller.yaml | 41 +++++++++++++++++++ environment.yml | 19 +++++++++ .../controller/README_CENTRAL_CONTROLLER.md | 18 +------- 3 files changed, 62 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/central-controller.yaml create mode 100644 environment.yml diff --git a/.github/workflows/central-controller.yaml b/.github/workflows/central-controller.yaml new file mode 100644 index 000000000..4908e7113 --- /dev/null +++ b/.github/workflows/central-controller.yaml @@ -0,0 +1,41 @@ +# on: +# workflow_dispatch: +on: + push: + workflow_dispatch: + +jobs: + central_controller: + name: Central Controller Build + runs-on: [gha-runner-x64, gha-runner-arm64] + steps: + - name: checkout + uses: actions/checkout@v4 + - name: Get Date + id: get-date + run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT + shell: bash + - name: Cache Conda + uses: actions/cache@v4 + with: + path: ~/miniconda3 + key: ${{ runner.os }}-${{ runner.arch }}-${{ steps.get-date.outputs.today }}-conda-${{ hashFiles('**/environment.yml') }} + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: false + channel-priority: strict + activate-environment: central_controller + environment-file: environment.yml + use-only-tar-bz2: true + - name: Setup CMake + uses: threeal/cmake-action@v2.1.0 + with: + options: | + -DCMAKE_BUILD_TYPE=Release + -DZT1_CENTRAL_CONTROLLER=1 + - name: Build + run: cmake --build . --config Release -- -j 4 + - name: SelfTest + run: | + ./build/zerotier-selftest \ No newline at end of file diff --git a/environment.yml b/environment.yml new file mode 100644 index 000000000..bdaabcf1c --- /dev/null +++ b/environment.yml @@ -0,0 +1,19 @@ +name: central_controller +channels: + - conda-forge +dependencies: + - conda-forge::cmake=3.27.4 + - conda-forge::git + - conda-forge::cxx-compiler + - conda-forge::c-compiler + - conda-forge::make + - conda-forge::pkg-config + - conda-forge::libpqxx=7.7.3 + - conda-forge::libopentelemetry-cpp=1.21.0 + - conda-forge::libopentelemetry-cpp-headers=1.21.0 + - conda-forge::google-cloud-cpp=2.39.0 + - conda-forge::libgoogle-cloud=2.39.0 + - conda-forge::rust=1.89.0 + - conda-forge::inja=3.3.0 + - conda-forge::libhiredis=1.3.0 + - conda-forge::nlohmann_json=3.12.0 diff --git a/nonfree/controller/README_CENTRAL_CONTROLLER.md b/nonfree/controller/README_CENTRAL_CONTROLLER.md index 9fd7f7707..3b37e3c32 100644 --- a/nonfree/controller/README_CENTRAL_CONTROLLER.md +++ b/nonfree/controller/README_CENTRAL_CONTROLLER.md @@ -25,22 +25,8 @@ conda config --set channel_priority strict Install external dependencies: ```bash -conda install -y -c conda-forge \ - conda-forge::cmake \ - conda-forge::git \ - conda-forge::cxx-compiler \ - conda-forge::c-compiler \ - conda-forge::make \ - conda-forge::pkg-config \ - conda-forge::libpqxx=7.7.3 \ - conda-forge::libopentelemetry-cpp=1.21.0 \ - conda-forge::libopentelemetry-cpp-headers=1.21.0 \ - conda-forge::google-cloud-cpp=2.39.0 \ - conda-forge::libgoogle-cloud=2.39.0 \ - conda-forge::rust=1.89.0 \ - conda-forge::inja=3.3.0 \ - conda-forge::libhiredis=1.3.0 \ - conda-forge::nlohmann_json=3.12.0 +conda env create -f environment.yaml +conda env activate central_controller ``` ## Build the Central Controller Binary