diff --git a/.github/workflows/bake.yml b/.github/workflows/bake.yml index 7bcf0660..7e0c805b 100644 --- a/.github/workflows/bake.yml +++ b/.github/workflows/bake.yml @@ -13,10 +13,6 @@ on: required: false default: '["test", "bench"]' description: Cargo profiles - docker_id: - type: string - required: false - description: Dockerhub acct/repo identity. feat_sets: type: string required: false @@ -53,11 +49,8 @@ on: default: '["testing-slim"]' description: System versions -env: - docker_id: ${{inputs.docker_id}} - jobs: - task: + bake: name: Bake runs-on: ${{matrix.machine}} strategy: @@ -75,7 +68,7 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Task + - name: Execute env: bake_target: ${{matrix.bake_target}} cargo_profile: ${{matrix.cargo_profile}} diff --git a/.github/workflows/base.yml b/.github/workflows/base.yml index d6b3ac5e..fe80497a 100644 --- a/.github/workflows/base.yml +++ b/.github/workflows/base.yml @@ -1,16 +1,15 @@ -name: Base Environment +name: Base on: workflow_call: jobs: systems: - name: Base Environment + name: System uses: ./.github/workflows/bake.yml with: bake_targets: '["systems"]' cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} feat_sets: ${{vars.FEAT_SETS}} machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} @@ -20,13 +19,12 @@ jobs: sys_versions: ${{vars.SYS_VERSIONS}} buildsys: - name: Build Environment + name: Builder uses: ./.github/workflows/bake.yml needs: [systems] with: bake_targets: '["buildsys"]' cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} feat_sets: ${{vars.FEAT_SETS}} machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} @@ -36,13 +34,12 @@ jobs: sys_versions: ${{vars.SYS_VERSIONS}} complement: - name: Test Environment + name: Tester uses: ./.github/workflows/bake.yml needs: [systems] with: bake_targets: '["complement-tester"]' cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} feat_sets: ${{vars.FEAT_SETS}} machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 19958d29..61723d53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,6 @@ jobs: with: bake_targets: '["install"]' cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} feat_sets: ${{vars.FEAT_SETS}} machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} @@ -26,7 +25,6 @@ jobs: with: bake_targets: '["complement-testee"]' cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} feat_sets: ${{vars.FEAT_SETS}} machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml index dbd14c17..34bb26bf 100644 --- a/.github/workflows/deps.yml +++ b/.github/workflows/deps.yml @@ -5,12 +5,11 @@ on: jobs: sources: - name: Acquire Source + name: Acquire uses: ./.github/workflows/bake.yml with: bake_targets: '["sources"]' cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} feat_sets: ${{vars.FEAT_SETS}} machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} @@ -20,13 +19,12 @@ jobs: sys_versions: ${{vars.SYS_VERSIONS}} rocksdb: - name: Build RocksDB + name: RocksDB uses: ./.github/workflows/bake.yml needs: [sources] with: bake_targets: '["rocksdb"]' cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} feat_sets: ${{vars.FEAT_SETS}} machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} @@ -36,13 +34,12 @@ jobs: sys_versions: ${{vars.SYS_VERSIONS}} deps: - name: Build Dependencies + name: Build uses: ./.github/workflows/bake.yml needs: [rocksdb] with: - bake_targets: '["deps"]' + bake_targets: '["deps-clippy", "deps-build-tests", "deps-build-bins"]' cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} feat_sets: ${{vars.FEAT_SETS}} machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index aabadc72..8c59deb5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,9 +9,36 @@ jobs: uses: ./.github/workflows/bake.yml with: bake_targets: '["fmt"]' - cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} - feat_sets: ${{vars.FEAT_SETS}} + cargo_profiles: '["test"]' + feat_sets: '["none"]' + machines: ${{vars.MACHINES}} + rust_targets: ${{vars.RUST_TARGETS}} + rust_toolchains: '["nightly"]' + sys_names: ${{vars.SYS_NAMES}} + sys_targets: ${{vars.SYS_TARGETS}} + sys_versions: ${{vars.SYS_VERSIONS}} + + audit: + name: Audit + uses: ./.github/workflows/bake.yml + with: + bake_targets: '["audit"]' + cargo_profiles: '["test"]' + feat_sets: '["none"]' + machines: ${{vars.MACHINES}} + rust_targets: ${{vars.RUST_TARGETS}} + rust_toolchains: '["nightly"]' + sys_names: ${{vars.SYS_NAMES}} + sys_targets: ${{vars.SYS_TARGETS}} + sys_versions: ${{vars.SYS_VERSIONS}} + + lychee: + name: Lychee + uses: ./.github/workflows/bake.yml + with: + bake_targets: '["lychee"]' + cargo_profiles: '["test"]' + feat_sets: '["none"]' machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} rust_toolchains: '["nightly"]' @@ -25,7 +52,6 @@ jobs: with: bake_targets: '["clippy"]' cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} feat_sets: ${{vars.FEAT_SETS}} machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} @@ -40,12 +66,11 @@ jobs: uses: ./.github/workflows/bake.yml with: bake_targets: '["docs"]' - cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} + cargo_profiles: '["test"]' feat_sets: ${{vars.FEAT_SETS}} machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} - rust_toolchains: ${{vars.RUST_TOOLCHAINS}} + rust_toolchains: '["nightly"]' sys_names: ${{vars.SYS_NAMES}} sys_targets: ${{vars.SYS_TARGETS}} sys_versions: ${{vars.SYS_VERSIONS}} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93116a7b..20c31cbe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,20 +7,13 @@ on: pull_request: branches: - "**" - workflow_dispatch: - inputs: - bake: - type: string - required: false - description: JSON Object of inputs passed to the environment concurrency: group: ${{github.workflow}}-${{github.ref}} cancel-in-progress: true env: - docker_id: ${{vars.DOCKER_ID}} inputs: ${{github.event.inputs}} jobs: @@ -29,12 +22,12 @@ jobs: uses: ./.github/workflows/base.yml deps: - name: Dependencies + name: Deps uses: ./.github/workflows/deps.yml needs: [base] lint: - name: Linting + name: Lint uses: ./.github/workflows/lint.yml needs: [deps] diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3861b6f1..78c11bbf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,12 +5,11 @@ on: jobs: unit: - name: Unit Tests + name: Unit uses: ./.github/workflows/bake.yml with: bake_targets: '["tests-unit"]' cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} feat_sets: ${{vars.FEAT_SETS}} machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} @@ -20,12 +19,11 @@ jobs: sys_versions: ${{vars.SYS_VERSIONS}} smoke: - name: Smoke Tests + name: Smoke uses: ./.github/workflows/bake.yml with: bake_targets: '["tests-smoke"]' cargo_profiles: ${{vars.CARGO_PROFILES}} - docker_id: ${{vars.DOCKER_ID}} feat_sets: ${{vars.FEAT_SETS}} machines: ${{vars.MACHINES}} rust_targets: ${{vars.RUST_TARGETS}} @@ -35,18 +33,19 @@ jobs: sys_versions: ${{vars.SYS_VERSIONS}} complement: - name: Compliance Tests + name: Compliance needs: [smoke] runs-on: ${{matrix.machine}} - concurrency: ${{matrix.feat_set}}-${{matrix.sys_name}}-${{matrix.sys_target}}-${{matrix.sys_version}} + #concurrency: ${{matrix.feat_set}}-${{matrix.sys_name}}-${{matrix.sys_target}}-${{matrix.sys_version}} + concurrency: complement-cant-walk-and-chew-bubblegum strategy: fail-fast: false matrix: - cargo_profile: ${{fromJSON(vars.CARGO_PROFILES)}} - feat_set: ${{fromJSON(vars.FEAT_SETS)}} + cargo_profile: ${{fromJSON('["test"]')}} + feat_set: ${{fromJSON('["all"]')}} machine: ${{fromJSON(vars.MACHINES)}} rust_target: ${{fromJSON(vars.RUST_TARGETS)}} - rust_toolchain: ${{fromJSON(vars.RUST_TOOLCHAINS)}} + rust_toolchain: ${{fromJSON('["nightly"]')}} sys_name: ${{fromJSON(vars.SYS_NAMES)}} sys_target: ${{fromJSON(vars.SYS_TARGETS)}} sys_version: ${{fromJSON(vars.SYS_VERSIONS)}} diff --git a/docker/Dockerfile.cargo.audit b/docker/Dockerfile.cargo.audit new file mode 100644 index 00000000..31555a78 --- /dev/null +++ b/docker/Dockerfile.cargo.audit @@ -0,0 +1,26 @@ +# syntax = docker/dockerfile:1.11-labs + +FROM input AS audit +ARG sys_target +ARG rust_toolchain="nightly" +ARG RUSTUP_HOME +ARG CARGO_HOME +ARG audit_args="" + +WORKDIR /usr/src/tuwunel +RUN \ +--mount=type=cache,dst=${RUSTUP_HOME},sharing=locked \ +--mount=type=cache,dst=${CARGO_HOME},sharing=locked \ +</dev/null -echo -e "\033[1;42;37mPASS\033[0m" +echo -e "\033[1;42;30mPASS\033[0m" diff --git a/engage.toml b/engage.toml deleted file mode 100644 index 210bafd5..00000000 --- a/engage.toml +++ /dev/null @@ -1,189 +0,0 @@ -interpreter = ["bash", "-euo", "pipefail", "-c"] - -[[task]] -name = "engage" -group = "versions" -script = "engage --version" - -[[task]] -name = "nix" -group = "versions" -script = "nix --version" - -[[task]] -name = "direnv" -group = "versions" -script = "direnv --version" - -[[task]] -name = "rustc" -group = "versions" -script = "rustc --version -v" - -[[task]] -name = "cargo" -group = "versions" -script = "cargo --version -v" - -[[task]] -name = "cargo-fmt" -group = "versions" -script = "cargo fmt --version" - -[[task]] -name = "rustdoc" -group = "versions" -script = "rustdoc --version" - -[[task]] -name = "cargo-clippy" -group = "versions" -script = "cargo clippy -- --version" - -[[task]] -name = "cargo-audit" -group = "versions" -script = "cargo audit --version" - -[[task]] -name = "cargo-deb" -group = "versions" -script = "cargo deb --version" - -[[task]] -name = "lychee" -group = "versions" -script = "lychee --version" - -[[task]] -name = "markdownlint" -group = "versions" -script = "markdownlint --version" - -[[task]] -name = "cargo-audit" -group = "security" -script = "cargo audit --color=always -D warnings -D unmaintained -D unsound -D yanked" - -[[task]] -name = "cargo-fmt" -group = "lints" -script = """ -cargo fmt --check -- --color=always -""" - -[[task]] -name = "cargo-doc" -group = "lints" -script = """ -env DIRENV_DEVSHELL=all-features \ - RUSTDOCFLAGS="-D warnings" \ - direnv exec . \ - cargo doc \ - --workspace \ - --locked \ - --profile test \ - --all-features \ - --no-deps \ - --document-private-items \ - --color always -""" - -[[task]] -name = "clippy/default" -group = "lints" -script = """ -direnv exec . \ -cargo clippy \ - --workspace \ - --locked \ - --profile test \ - --color=always \ - -- \ - -D warnings -""" - -[[task]] -name = "clippy/all" -group = "lints" -script = """ -env DIRENV_DEVSHELL=all-features \ - direnv exec . \ - cargo clippy \ - --workspace \ - --locked \ - --profile test \ - --all-features \ - --color=always \ - -- \ - -D warnings -""" - -[[task]] -name = "clippy/no-features" -group = "lints" -script = """ -env DIRENV_DEVSHELL=no-features \ - direnv exec . \ - cargo clippy \ - --workspace \ - --locked \ - --profile test \ - --no-default-features \ - --color=always \ - -- \ - -D warnings -""" - -[[task]] -name = "clippy/other-features" -group = "lints" -script = """ -direnv exec . \ -cargo clippy \ - --workspace \ - --locked \ - --profile test \ - --no-default-features \ - --features=console,systemd,element_hacks,direct_tls,perf_measurements,brotli_compression,blurhashing \ - --color=always \ - -- \ - -D warnings -""" - -[[task]] -name = "lychee" -group = "lints" -script = "lychee --verbose --offline docs *.md --exclude development.md --exclude contributing.md --exclude testing.md" - -[[task]] -name = "markdownlint" -group = "lints" -script = "markdownlint docs *.md || true" # TODO: fix the ton of markdown lints so we can drop `|| true` - -[[task]] -name = "cargo/default" -group = "tests" -script = """ -env DIRENV_DEVSHELL=default \ - direnv exec . \ - cargo test \ - --workspace \ - --locked \ - --profile test \ - --all-targets \ - --no-fail-fast \ - --color=always \ - -- \ - --color=always -""" - -# Checks if the generated example config differs from the checked in repo's -# example config. -[[task]] -name = "example-config" -group = "tests" -depends = ["cargo/default"] -script = """ -git diff --exit-code conduwuit-example.toml -"""