diff --git a/.github/workflows/001-tester-ubuntu-make-test-auraed.yml b/.github/workflows/001-tester-ubuntu-make-lint-test-auraed.yml similarity index 92% rename from .github/workflows/001-tester-ubuntu-make-test-auraed.yml rename to .github/workflows/001-tester-ubuntu-make-lint-test-auraed.yml index 062bbc9b4..b41934095 100644 --- a/.github/workflows/001-tester-ubuntu-make-test-auraed.yml +++ b/.github/workflows/001-tester-ubuntu-make-lint-test-auraed.yml @@ -91,9 +91,5 @@ jobs: 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 + - name: Lint and test [auraed] + run: make auraed-lint auraed-test diff --git a/.github/workflows/002-tester-ubuntu-make-test-auraescript.yml b/.github/workflows/002-tester-ubuntu-make-lint-test-auraescript.yml similarity index 92% rename from .github/workflows/002-tester-ubuntu-make-test-auraescript.yml rename to .github/workflows/002-tester-ubuntu-make-lint-test-auraescript.yml index e848c02b5..17197765f 100644 --- a/.github/workflows/002-tester-ubuntu-make-test-auraescript.yml +++ b/.github/workflows/002-tester-ubuntu-make-lint-test-auraescript.yml @@ -86,9 +86,5 @@ jobs: 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 + - name: Lint and test [auraescript] + run: make auraescript-lint auraescript-test diff --git a/.github/workflows/003-tester-ubuntu-make-test-aer.yml b/.github/workflows/003-tester-ubuntu-make-lint-test-aer.yml similarity index 92% rename from .github/workflows/003-tester-ubuntu-make-test-aer.yml rename to .github/workflows/003-tester-ubuntu-make-lint-test-aer.yml index 88a9d2d79..ad8c7a043 100644 --- a/.github/workflows/003-tester-ubuntu-make-test-aer.yml +++ b/.github/workflows/003-tester-ubuntu-make-lint-test-aer.yml @@ -86,9 +86,5 @@ jobs: 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 aer-test + - name: Lint and test [aer] + run: make aer-lint aer-test diff --git a/.github/workflows/004-ubuntu-make-test-all.yml b/.github/workflows/004-ubuntu-make-test-all.yml new file mode 100644 index 000000000..dcb8e3e7d --- /dev/null +++ b/.github/workflows/004-ubuntu-make-test-all.yml @@ -0,0 +1,94 @@ +# ---------------------------------------------------------------------------- # +# # +# +--------------------------------------------+ # +# | █████╗ ██╗ ██╗██████╗ █████╗ ███████╗ | # +# | ██╔══██╗██║ ██║██╔══██╗██╔══██╗██╔════╝ | # +# | ███████║██║ ██║██████╔╝███████║█████╗ | # +# | ██╔══██║██║ ██║██╔══██╗██╔══██║██╔══╝ | # +# | ██║ ██║╚██████╔╝██║ ██║██║ ██║███████╗ | # +# | ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ | # +# +--------------------------------------------+ # +# # +# Distributed Systems Runtime # +# # +# ---------------------------------------------------------------------------- # +# # +# Copyright 2022 - 2024, the Aurae contributors # +# SPDX-License-Identifier: Apache-2.0 # +# # +# ---------------------------------------------------------------------------- # +# +# This is the "test all the things" workflow for aurae +# +# This build check will introduce confidence for the following: +# +# - That the code does not warn (due to clippy errors/warnings) +# +name: "Test all (004) [ubuntu:latest] [test-all]" +on: + push: + branches: main + pull_request: + branches: main +env: + CARGO_TERM_COLOR: always +jobs: + test-all: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: bufbuild/buf-setup-action@v1 + with: + github_token: ${{ github.token }} + version: 1.32.0 + - 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 rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: stable + components: clippy, rustfmt + - 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: test-all + # 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 test-all diff --git a/Cargo.lock b/Cargo.lock index 072202bb6..93f0a8d6d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2056,18 +2056,18 @@ dependencies = [ [[package]] name = "derive_builder" -version = "0.20.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" dependencies = [ "derive_builder_macro", ] [[package]] name = "derive_builder_core" -version = "0.20.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" dependencies = [ "darling", "proc-macro2", @@ -2077,9 +2077,9 @@ dependencies = [ [[package]] name = "derive_builder_macro" -version = "0.20.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" dependencies = [ "derive_builder_core", "syn 2.0.72", diff --git a/Makefile b/Makefile index e49d642e6..367090f51 100644 --- a/Makefile +++ b/Makefile @@ -40,9 +40,9 @@ clh_version = 30.0 vm_kernel = 6.1.6 vm_image = https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img ifeq ($(uid), 0) -root_cargo = cargo +root_cargo = $(cargo) else -root_cargo = sudo -E cargo +root_cargo = sudo -E `which cargo` endif # Configuration Options @@ -60,12 +60,7 @@ export GIT_PAGER = cat # Keep all as the first command to have it be the default as per convention .PHONY: all -all: install ## alias for install - -# ⚠️ DO NOT REMOVE ⚠️ -.PHONY: nova -nova: auraed aer auraescript ## The official Kris Nóva alias for her workflow that only exists in her head. -# ⚠️ DO NOT REMOVE ⚠️ +all: build dir := $(dir $(lastword $(MAKEFILE_LIST))) include $(dir)/hack/_common.mk @@ -88,22 +83,22 @@ clean: clean-certs clean-gens clean-crates ## Clean the repo lint: musl auraed-lint not-auraed-lint ## Run all lints .PHONY: test -test: musl auraed-build auraed-lint auraed-test not-auraed-build not-auraed-lint not-auraed-test ## Builds, lints, and tests (does not include ignored tests) +test: musl lint build auraed-test not-auraed-test ## Builds, lints, and tests (does not include ignored tests) .PHONY: test-all -test-all: musl auraed-build auraed-lint auraed-test-all not-auraed-build not-auraed-lint not-auraed-test-all ## Run lints and tests (includes ignored tests) +test-all: musl lint build auraed-test-all not-auraed-test-all ## Run lints and tests (includes ignored tests) .PHONY: build -build: musl auraed-build auraed-lint not-auraed-build not-auraed-lint ## Build and lint +build: musl auraed-build not-auraed-build ## Build and lint .PHONY: install -install: musl lint test auraed-debug auraescript-debug aer-debug ## Lint, test, and install (debug) 🎉 +install: musl test auraed-debug auraescript-debug aer-debug ## Lint, test, and install (debug) 🎉 .PHONY: docs docs: docs-crates docs-stdlib docs-other ## Assemble all the /docs for the website locally. .PHONY: prcheck -prcheck: build lint test-all docs docs-lint ## Meant to mimic the GHA checks (includes ignored tests) +prcheck: pki build lint test-all docs docs-lint ## Meant to mimic the GHA checks (includes ignored tests) #------------------------------------------------------------------------------# @@ -202,18 +197,18 @@ $(1): musl $(GEN_RS) $(GEN_TS) $(1)-lint $(1)-debug ## Lint and install $(1) (fo .PHONY: $(1)-lint $(1)-lint: musl $(GEN_RS) $(GEN_TS) - $$(cargo) clippy $(2) -p $(1) --all-features -- -D clippy::all -D warnings + $(cargo) clippy $(2) -p $(1) --all-features -- -D clippy::all -D warnings .PHONY: $(1)-test -$(1)-test: musl $(GEN_RS) $(GEN_TS) auraed +$(1)-test: musl $(GEN_RS) $(GEN_TS) auraed-debug $(cargo) test $(2) -p $(1) .PHONY: $(1)-test-all -$(1)-test-all: musl $(GEN_RS) $(GEN_TS) auraed +$(1)-test-all: musl $(GEN_RS) $(GEN_TS) auraed-debug $(root_cargo) test $(2) -p $(1) -- --include-ignored .PHONY: $(1)-test-integration -$(1)-test-integration: musl $(GEN_RS) $(GEN_TS) auraed +$(1)-test-integration: musl $(GEN_RS) $(GEN_TS) auraed-debug $(root_cargo) test $(2) -p $(1) --test '*' -- --include-ignored .PHONY: $(1)-test-watch @@ -234,7 +229,7 @@ $(1)-debug: musl $(GEN_RS) $(GEN_TS) $(1)-lint .PHONY: $(1)-release $(1)-release: musl $(GEN_RS) $(GEN_TS) $(1)-lint $(1)-test ## Lint, test, and install $(1) - $(cargo) install $(2) --path ./$(1) --force + $(cargo) install --path ./$(1) --force endef MUSL_TARGET=--target $(uname_m)-unknown-linux-musl