Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify make actions #518

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
94 changes: 94 additions & 0 deletions .github/workflows/004-ubuntu-make-test-all.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 13 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)

#------------------------------------------------------------------------------#

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading