From d633ce3667a9e451f8e3a04352f93f190a230287 Mon Sep 17 00:00:00 2001 From: dominic <510002+dmah42@users.noreply.github.com> Date: Sun, 21 Jan 2024 16:14:21 +0000 Subject: [PATCH] Split github tester actions to minimise disk use (#497) * split the github tester actions to minimise disk use * split docker build too --- .../001-tester-ubuntu-make-test-auraed.yml | 104 ++++++++++++++++++ ...02-tester-ubuntu-make-test-auraescript.yml | 104 ++++++++++++++++++ ...ml => 003-tester-ubuntu-make-test-aer.yml} | 4 +- ...ae-builder-make-pki-config-test-auraed.yml | 74 +++++++++++++ ...ilder-make-pki-config-test-auraescript.yml | 74 +++++++++++++ ...urae-builder-make-pki-config-test-aer.yml} | 4 +- 6 files changed, 360 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/001-tester-ubuntu-make-test-auraed.yml create mode 100644 .github/workflows/002-tester-ubuntu-make-test-auraescript.yml rename .github/workflows/{001-tester-ubuntu-make-test.yml => 003-tester-ubuntu-make-test-aer.yml} (98%) create mode 100644 .github/workflows/101-tester-aurae-builder-make-pki-config-test-auraed.yml create mode 100644 .github/workflows/102-tester-aurae-builder-make-pki-config-test-auraescript.yml rename .github/workflows/{101-tester-aurae-builder-make-pki-config-test.yml => 103-tester-aurae-builder-make-pki-config-test-aer.yml} (97%) diff --git a/.github/workflows/001-tester-ubuntu-make-test-auraed.yml b/.github/workflows/001-tester-ubuntu-make-test-auraed.yml new file mode 100644 index 000000000..a4620440d --- /dev/null +++ b/.github/workflows/001-tester-ubuntu-make-test-auraed.yml @@ -0,0 +1,104 @@ +# ---------------------------------------------------------------------------- # +# Apache 2.0 License Copyright © 2022-2023 The Aurae Authors # +# # +# +--------------------------------------------+ # +# | █████╗ ██╗ ██╗██████╗ █████╗ ███████╗ | # +# | ██╔══██╗██║ ██║██╔══██╗██╔══██╗██╔════╝ | # +# | ███████║██║ ██║██████╔╝███████║█████╗ | # +# | ██╔══██║██║ ██║██╔══██╗██╔══██║██╔══╝ | # +# | ██║ ██║╚██████╔╝██║ ██║██║ ██║███████╗ | # +# | ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ | # +# +--------------------------------------------+ # +# # +# Distributed Systems Runtime # +# # +# ---------------------------------------------------------------------------- # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# # +# ---------------------------------------------------------------------------- # +# +# This is the main compile time check for Aurae. +# +# This build check will introduce confidence for the following: +# +# - That the binary does not have unexpected dependencies. +# - We intentionally build this on a clean ubuntu image, to prove that we can +# generate a static binary with minimal dependencies. +# - That the code does not warn (due to clippy errors/warnings) +# +# When this build passes we should have a "clean cargo" output! +# +name: "Tester (001) [ubuntu:latest] [auraed]" +on: + push: + branches: main + pull_request: + branches: main +env: + CARGO_TERM_COLOR: always +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: bufbuild/buf-setup-action@v1 + with: + github_token: ${{ github.token }} + version: 1.28.1 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: 000-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + 000-${{ runner.os }}-cargo- + - name: Install protoc-gen-doc in [ubuntu:latest] + run: | + wget https://github.com/pseudomuto/protoc-gen-doc/releases/download/v1.5.1/protoc-gen-doc_1.5.1_linux_amd64.tar.gz + tar -xzf protoc-gen-doc_1.5.1_linux_amd64.tar.gz + chmod +x protoc-gen-doc + cp protoc-gen-doc /usr/local/bin/protoc-gen-doc + sudo apt-get update + sudo apt-get install -y protobuf-compiler + - name: Install compile time dependencies (musl-tools) in [ubuntu:latest] + # + # Do not add GNU libraries here! Do not add GNU libraries here! + # + # Please (seriously please) be careful about adding commands here. + # This is our core way of validating that our binary is "healthy" + # If we need to install anything with the word "lib" in it to get + # the build to pass, we likely should be having other discussions + # instead of adding commands here. + # + # Do not add GNU libraries here! Do not add GNU libraries here! + # + # For example, we should NOT be adding libraries such as "libseccomp" + # or "libdbus". + # + # If in doubt, please ask in Discord in the build channel. + # + # Do not at GNU libraries here! Do not add GNU libraries here! + run: | + sudo apt-get update + sudo apt-get install -y musl-tools + - name: Cargo build, lint, test [make test] + # This should remain the only command we execute as this matches the title of the file. + # The goal is for this to be easy to find from the GitHub dashboard. + # Instead of adding more commands here, consider another make target or a new YAML file + # named with a good name. + run: make auraed-test diff --git a/.github/workflows/002-tester-ubuntu-make-test-auraescript.yml b/.github/workflows/002-tester-ubuntu-make-test-auraescript.yml new file mode 100644 index 000000000..088ae7061 --- /dev/null +++ b/.github/workflows/002-tester-ubuntu-make-test-auraescript.yml @@ -0,0 +1,104 @@ +# ---------------------------------------------------------------------------- # +# Apache 2.0 License Copyright © 2022-2023 The Aurae Authors # +# # +# +--------------------------------------------+ # +# | █████╗ ██╗ ██╗██████╗ █████╗ ███████╗ | # +# | ██╔══██╗██║ ██║██╔══██╗██╔══██╗██╔════╝ | # +# | ███████║██║ ██║██████╔╝███████║█████╗ | # +# | ██╔══██║██║ ██║██╔══██╗██╔══██║██╔══╝ | # +# | ██║ ██║╚██████╔╝██║ ██║██║ ██║███████╗ | # +# | ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ | # +# +--------------------------------------------+ # +# # +# Distributed Systems Runtime # +# # +# ---------------------------------------------------------------------------- # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# # +# ---------------------------------------------------------------------------- # +# +# This is the main compile time check for Aurae. +# +# This build check will introduce confidence for the following: +# +# - That the binary does not have unexpected dependencies. +# - We intentionally build this on a clean ubuntu image, to prove that we can +# generate a static binary with minimal dependencies. +# - That the code does not warn (due to clippy errors/warnings) +# +# When this build passes we should have a "clean cargo" output! +# +name: "Tester (002) [ubuntu:latest] [auraescript]" +on: + push: + branches: main + pull_request: + branches: main +env: + CARGO_TERM_COLOR: always +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: bufbuild/buf-setup-action@v1 + with: + github_token: ${{ github.token }} + version: 1.28.1 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: 000-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + 000-${{ runner.os }}-cargo- + - name: Install protoc-gen-doc in [ubuntu:latest] + run: | + wget https://github.com/pseudomuto/protoc-gen-doc/releases/download/v1.5.1/protoc-gen-doc_1.5.1_linux_amd64.tar.gz + tar -xzf protoc-gen-doc_1.5.1_linux_amd64.tar.gz + chmod +x protoc-gen-doc + cp protoc-gen-doc /usr/local/bin/protoc-gen-doc + sudo apt-get update + sudo apt-get install -y protobuf-compiler + - name: Install compile time dependencies (musl-tools) in [ubuntu:latest] + # + # Do not add GNU libraries here! Do not add GNU libraries here! + # + # Please (seriously please) be careful about adding commands here. + # This is our core way of validating that our binary is "healthy" + # If we need to install anything with the word "lib" in it to get + # the build to pass, we likely should be having other discussions + # instead of adding commands here. + # + # Do not add GNU libraries here! Do not add GNU libraries here! + # + # For example, we should NOT be adding libraries such as "libseccomp" + # or "libdbus". + # + # If in doubt, please ask in Discord in the build channel. + # + # Do not at GNU libraries here! Do not add GNU libraries here! + run: | + sudo apt-get update + sudo apt-get install -y musl-tools + - name: Cargo build, lint, test [make test] + # This should remain the only command we execute as this matches the title of the file. + # The goal is for this to be easy to find from the GitHub dashboard. + # Instead of adding more commands here, consider another make target or a new YAML file + # named with a good name. + run: make auraescript-test diff --git a/.github/workflows/001-tester-ubuntu-make-test.yml b/.github/workflows/003-tester-ubuntu-make-test-aer.yml similarity index 98% rename from .github/workflows/001-tester-ubuntu-make-test.yml rename to .github/workflows/003-tester-ubuntu-make-test-aer.yml index d1617920f..da14293a8 100644 --- a/.github/workflows/001-tester-ubuntu-make-test.yml +++ b/.github/workflows/003-tester-ubuntu-make-test-aer.yml @@ -39,7 +39,7 @@ # # When this build passes we should have a "clean cargo" output! # -name: "Tester (001) [ubuntu:latest]" +name: "Tester (003) [ubuntu:latest] [aer]" on: push: branches: main @@ -101,4 +101,4 @@ jobs: # The goal is for this to be easy to find from the GitHub dashboard. # Instead of adding more commands here, consider another make target or a new YAML file # named with a good name. - run: make test + run: make aer-test diff --git a/.github/workflows/101-tester-aurae-builder-make-pki-config-test-auraed.yml b/.github/workflows/101-tester-aurae-builder-make-pki-config-test-auraed.yml new file mode 100644 index 000000000..28e79821d --- /dev/null +++ b/.github/workflows/101-tester-aurae-builder-make-pki-config-test-auraed.yml @@ -0,0 +1,74 @@ +# ---------------------------------------------------------------------------- # +# Apache 2.0 License Copyright © 2022-2023 The Aurae Authors # +# # +# +--------------------------------------------+ # +# | █████╗ ██╗ ██╗██████╗ █████╗ ███████╗ | # +# | ██╔══██╗██║ ██║██╔══██╗██╔══██╗██╔════╝ | # +# | ███████║██║ ██║██████╔╝███████║█████╗ | # +# | ██╔══██║██║ ██║██╔══██╗██╔══██║██╔══╝ | # +# | ██║ ██║╚██████╔╝██║ ██║██║ ██║███████╗ | # +# | ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ | # +# +--------------------------------------------+ # +# # +# Distributed Systems Runtime # +# # +# ---------------------------------------------------------------------------- # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# # +# ---------------------------------------------------------------------------- # +# +name: "Tester (101) [aurae-builder:builder-latest] [auraed]" +on: + push: + branches: main + pull_request: + branches: main + +permissions: + contents: read + packages: write +env: + CARGO_TERM_COLOR: always +jobs: + build-container: + uses: ./.github/workflows/100-aurae-builder-image-docker-build-builder.yml + build: + name: Build (lint, compile, test) + runs-on: ubuntu-latest + needs: build-container + timeout-minutes: 30 + container: + image: ghcr.io/${{ github.repository }}/aurae-builder:builder-latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: 100-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + 100-${{ runner.os }}-cargo- + - name: Cargo Test [make pki config test] + # This should remain the only command we execute as this matches the title of the file. + # The goal is for this to be easy to find from the GitHub dashboard. + # Instead of adding more commands here, consider another make target or a new YAML file + # named with a good name. + run: make pki config auraed-test diff --git a/.github/workflows/102-tester-aurae-builder-make-pki-config-test-auraescript.yml b/.github/workflows/102-tester-aurae-builder-make-pki-config-test-auraescript.yml new file mode 100644 index 000000000..c5f695382 --- /dev/null +++ b/.github/workflows/102-tester-aurae-builder-make-pki-config-test-auraescript.yml @@ -0,0 +1,74 @@ +# ---------------------------------------------------------------------------- # +# Apache 2.0 License Copyright © 2022-2023 The Aurae Authors # +# # +# +--------------------------------------------+ # +# | █████╗ ██╗ ██╗██████╗ █████╗ ███████╗ | # +# | ██╔══██╗██║ ██║██╔══██╗██╔══██╗██╔════╝ | # +# | ███████║██║ ██║██████╔╝███████║█████╗ | # +# | ██╔══██║██║ ██║██╔══██╗██╔══██║██╔══╝ | # +# | ██║ ██║╚██████╔╝██║ ██║██║ ██║███████╗ | # +# | ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ | # +# +--------------------------------------------+ # +# # +# Distributed Systems Runtime # +# # +# ---------------------------------------------------------------------------- # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); # +# you may not use this file except in compliance with the License. # +# You may obtain a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # +# See the License for the specific language governing permissions and # +# limitations under the License. # +# # +# ---------------------------------------------------------------------------- # +# +name: "Tester (102) [aurae-builder:builder-latest] [auraescript]" +on: + push: + branches: main + pull_request: + branches: main + +permissions: + contents: read + packages: write +env: + CARGO_TERM_COLOR: always +jobs: + build-container: + uses: ./.github/workflows/100-aurae-builder-image-docker-build-builder.yml + build: + name: Build (lint, compile, test) + runs-on: ubuntu-latest + needs: build-container + timeout-minutes: 30 + container: + image: ghcr.io/${{ github.repository }}/aurae-builder:builder-latest + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: 100-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + 100-${{ runner.os }}-cargo- + - name: Cargo Test [make pki config test] + # This should remain the only command we execute as this matches the title of the file. + # The goal is for this to be easy to find from the GitHub dashboard. + # Instead of adding more commands here, consider another make target or a new YAML file + # named with a good name. + run: make pki config auraescript-test diff --git a/.github/workflows/101-tester-aurae-builder-make-pki-config-test.yml b/.github/workflows/103-tester-aurae-builder-make-pki-config-test-aer.yml similarity index 97% rename from .github/workflows/101-tester-aurae-builder-make-pki-config-test.yml rename to .github/workflows/103-tester-aurae-builder-make-pki-config-test-aer.yml index eefe00378..8f52f3cbb 100644 --- a/.github/workflows/101-tester-aurae-builder-make-pki-config-test.yml +++ b/.github/workflows/103-tester-aurae-builder-make-pki-config-test-aer.yml @@ -28,7 +28,7 @@ # # # ---------------------------------------------------------------------------- # # -name: "Tester (101) [aurae-builder:builder-latest]" +name: "Tester (103) [aurae-builder:builder-latest] [aer]" on: push: branches: main @@ -71,4 +71,4 @@ jobs: # The goal is for this to be easy to find from the GitHub dashboard. # Instead of adding more commands here, consider another make target or a new YAML file # named with a good name. - run: make pki config test + run: make pki config aer-test