From f60dbba80b3e488253ee28a2e952cc8e002961d6 Mon Sep 17 00:00:00 2001 From: Brian Ginsburg Date: Thu, 8 Feb 2024 13:18:47 -0800 Subject: [PATCH] chore: More schemas action tweaks --- .github/workflows/audit.yml | 32 +- .github/workflows/builds.yml | 804 ++++++++++++------------- .github/workflows/coverage.yml | 180 +++--- .github/workflows/dependabot_pr.yaml | 94 +-- .github/workflows/docker.yml | 92 +-- .github/workflows/nix.yml | 118 ++-- .github/workflows/release.yml | 120 ++-- .github/workflows/schemas.yml | 43 ++ .github/workflows/tests_and_checks.yml | 732 +++++++++++----------- homestar-schemas/src/main.rs | 2 +- 10 files changed, 1130 insertions(+), 1087 deletions(-) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 569d60d3..08da9156 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -1,21 +1,21 @@ -name: ๐Ÿ›ก Audit-Check +# name: ๐Ÿ›ก Audit-Check -on: - schedule: - - cron: '0 0 * * *' +# on: +# schedule: +# - cron: '0 0 * * *' -jobs: - security-audit: - runs-on: ubuntu-latest +# jobs: +# security-audit: +# runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v4 - - name: Cache Project - uses: Swatinem/rust-cache@v2 +# - name: Cache Project +# uses: Swatinem/rust-cache@v2 - - name: Run Audit-Check - uses: rustsec/audit-check@v1.4.1 - with: - token: ${{ secrets.GITHUB_TOKEN }} +# - name: Run Audit-Check +# uses: rustsec/audit-check@v1.4.1 +# with: +# token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 4ecc60ab..93f80b13 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -1,402 +1,402 @@ -name: โšƒ Builds - -# TODO: brew formula (Macs), cargo-wix (Windows Installs), cargo-aur (Arch) - -on: - workflow_dispatch: - inputs: - force-builds: - required: true - type: boolean - description: Publish Builds at Anytime - - release: - types: [published] - - # for debugging - # pull_request: - # branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - CARGO_INCREMENTAL: 0 - -jobs: - binary-builds: - if: > - startsWith(github.event.release.name, 'homestar-runtime') || - (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) - strategy: - fail-fast: false - matrix: - include: - - target: aarch64-unknown-linux-gnu - - target: aarch64-unknown-linux-musl - npm: linux-arm64 - - target: aarch64-apple-darwin - os: macos-latest - npm: darwin-arm64 - - target: x86_64-unknown-linux-gnu - - target: x86_64-unknown-linux-musl - npm: linux-x64 - - target: x86_64-apple-darwin - os: macos-latest - npm: darwin-x64 - - target: x86_64-pc-windows-msvc - os: windows-latest - npm: windows-x64 - - target: x86_64-unknown-freebsd - - permissions: - contents: write - - timeout-minutes: 60 - runs-on: ${{ matrix.os || 'ubuntu-latest' }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install musl-tools - run: sudo apt update && sudo apt install -y musl-dev musl-tools - if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl' - - - name: Install Rust Toolchain - id: toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: check-${{ matrix.target }}-${{ matrix.os }} - - - name: cross-build - uses: taiki-e/setup-cross-toolchain-action@v1 - with: - target: ${{ matrix.target }} - - - name: crt-static - run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >>"${GITHUB_ENV}" - if: endsWith(matrix.target, 'windows-msvc') - - - name: Compile - run: cargo build -p homestar-runtime --locked --release --target ${{ matrix.target }} - - - name: Upload Release Artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.target }} - path: target/${{ matrix.target }}/release/homestar* - if-no-files-found: error - - - name: Publish Binary in Release - if: github.event_name == 'release' && github.event.action == 'published' - uses: taiki-e/upload-rust-binary-action@v1 - with: - bin: homestar - target: ${{ matrix.target }} - tar: all - zip: windows - include: LICENSE,README.md - token: ${{ secrets.GITHUB_TOKEN }} - - npm-publish-arch: - needs: binary-builds - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - target: aarch64-unknown-linux-musl - os: linux - arch: arm64 - bin: homestar - - target: x86_64-unknown-linux-musl - os: linux - arch: x64 - bin: homestar - - target: aarch64-apple-darwin - os: darwin - arch: arm64 - bin: homestar - - target: x86_64-apple-darwin - os: darwin - arch: x64 - bin: homestar - - target: x86_64-pc-windows-msvc - os: windows - arch: x64 - bin: homestar.exe - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: lts/* - registry-url: "https://registry.npmjs.org" - - - name: Install cargo-get - run: cargo install cargo-get - - - name: Prepare OS/Arch Packages - shell: bash - env: - node_os: ${{ matrix.os }} - node_arch: ${{ matrix.arch }} - node_pkg: homestar-${{ matrix.os }}-${{ matrix.arch }} - run: | - export node_version=$(cargo get workspace.package.version) - echo "node_pkg=${node_pkg}" >> "$GITHUB_ENV" - cd homestar-runtime/npm - mkdir -p "${node_pkg}/bin" - envsubst < package-json-arch.tmpl > "${node_pkg}/package.json" - - - name: Download Build Artifacts - uses: actions/download-artifact@v4 - with: - name: ${{ matrix.target }} - path: "homestar-runtime/npm/${{ env.node_pkg }}/bin" - - - name: Publish Arch Packages to Production - if: github.event_name == 'release' && github.event.action == 'published' - run: | - cp homestar-runtime/README.md "homestar-runtime/npm/${{ env.node_pkg }}" - cd "homestar-runtime/npm/${{ env.node_pkg }}" - chmod +x bin/${{ matrix.bin }} - npm publish --access=public - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - - name: Publish Arch Packages as RC - if: github.event_name == 'workflow_dispatch' - run: | - cp homestar-runtime/README.md "homestar-runtime/npm/${{ env.node_pkg }}" - cd "homestar-runtime/npm/${{ env.node_pkg }}" - chmod +x bin/${{ matrix.bin }} - npm version $(cargo get package.version)-rc.$(date +%s) --git-tag-version false - npm publish --access public --tag rc - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - npm-publish-main: - needs: npm-publish-arch - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: lts/* - registry-url: "https://registry.npmjs.org" - - - name: Install cargo get - run: cargo install cargo-get - - - name: Publish main package to Production - if: github.event_name == 'release' && github.event.action == 'published' - run: | - export node_version=$(cargo get workspace.package.version) - cp homestar-runtime/README.md homestar-runtime/npm/base - cd homestar-runtime/npm - envsubst < package-json-base.tmpl > "base/package.json" - cd base - npm publish --access=public - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - - name: Publish main package as RC - if: (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) - run: | - export node_version="$(cargo get workspace.package.version)-rc.$(date +%s)" - cp homestar-runtime/README.md homestar-runtime/npm/base - cd homestar-runtime/npm - envsubst < package-json-baserc.tmpl > "base/package.json" - cd base - npm publish --access public --tag rc - env: - NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - build-packages: - needs: binary-builds - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-unknown-linux-gnu - - target: x86_64-unknown-linux-musl - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install musl-tools - run: sudo apt update && sudo apt install -y musl-dev musl-tools - if: matrix.target == 'x86_64-unknown-linux-musl' - - - name: Install Rust toolchain - id: toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: stable - targets: ${{ matrix.target }} - - - name: Override rust-toolchain.toml - run: rustup override set ${{steps.toolchain.outputs.name}} - - - name: Install cargo-deb - uses: taiki-e/cache-cargo-install-action@v1 - with: - tool: cargo-deb - - - name: Install cargo-generate-rpm - uses: taiki-e/cache-cargo-install-action@v1 - with: - tool: cargo-generate-rpm - - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: check-${{ matrix.target }}-ubuntu-latest - - - name: Create .deb - run: cargo deb -p homestar-runtime --target ${{ matrix.target }} --variant ${{ matrix.target }} --output homestar-${{ matrix.target }}.deb - - - name: Create .rpm - run: cargo generate-rpm -p homestar-runtime --target ${{ matrix.target }} --variant ${{ matrix.target }} --output homestar-${{ matrix.target }}.rpm - - - name: Upload Release Artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.target }}-packages - path: | - *.deb - *.rpm - if-no-files-found: error - - - name: Publish Package in Release - uses: softprops/action-gh-release@v1 - if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' && github.event.action == 'published' - with: - files: | - *.deb - *.rpm - - docker-build: - if: > - startsWith(github.event.release.name, 'homestar-runtime') || - (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) - runs-on: ubuntu-latest - env: - DOCKER_BUILDKIT: "1" - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - - permissions: - contents: read - id-token: write - packages: write - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Cleanup - run: | - # Workaround to provide additional free space for testing. - # https://github.com/actions/virtual-environments/issues/2840 - rm -rf /opt/hostedtoolcache - rm -rf /usr/share/dotnet - rm -rf /opt/ghc - rm -rf "$AGENT_TOOLSDIRECTORY" - sudo apt-get clean - sudo rm -rf /usr/share/dotnet - - - name: Install cargo-get - if: (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) - run: cargo install cargo-get - - - name: Set Current Version - if: (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) - id: crate-version - run: echo version=$(cargo get workspace.package.version)-rc.$(date +%s) >> $GITHUB_OUTPUT - - - name: Set Env - run: | - echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - echo "GIT_TIMESTAMP=$(git log -1 --pretty=format:'%cI')" >> $GITHUB_ENV - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - - name: Setup Buildx - uses: docker/setup-buildx-action@v3 - - - name: Metadata - if: github.event_name != 'workflow_dispatch' - id: meta-release - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - type=raw,value=latest - type=sha - - - name: Metadata - if: (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) - id: meta-dispatch - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{version}},value=${{ steps.crate-version.outputs.version }} - type=raw,value=latest - type=sha - - - name: Docker Build & Push - if: github.event_name != 'workflow_dispatch' - uses: docker/build-push-action@v5 - with: - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - cache-to: type=inline - file: docker/Dockerfile - context: . - platforms: linux/amd64,linux/arm64 - build-args: | - git_sha=${{ env.GIT_SHA }} - git_timestamp=${{ env.GIT_TIMESTAMP }} - push: true - tags: ${{ steps.meta-release.outputs.tags }} - labels: ${{ steps.meta-release.outputs.labels }} - - - name: Docker Build & Push - if: (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) - uses: docker/build-push-action@v5 - with: - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - cache-to: type=inline - file: docker/Dockerfile - context: . - platforms: linux/amd64,linux/arm64 - build-args: | - git_sha=${{ env.GIT_SHA }} - git_timestamp=${{ env.GIT_TIMESTAMP }} - push: true - tags: ${{ steps.meta-dispatch.outputs.tags }} - labels: ${{ steps.meta-dispatch.outputs.labels }} +# name: โšƒ Builds + +# # TODO: brew formula (Macs), cargo-wix (Windows Installs), cargo-aur (Arch) + +# on: +# workflow_dispatch: +# inputs: +# force-builds: +# required: true +# type: boolean +# description: Publish Builds at Anytime + +# release: +# types: [published] + +# # for debugging +# # pull_request: +# # branches: ["**"] + +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true + +# env: +# CARGO_INCREMENTAL: 0 + +# jobs: +# binary-builds: +# if: > +# startsWith(github.event.release.name, 'homestar-runtime') || +# (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) +# strategy: +# fail-fast: false +# matrix: +# include: +# - target: aarch64-unknown-linux-gnu +# - target: aarch64-unknown-linux-musl +# npm: linux-arm64 +# - target: aarch64-apple-darwin +# os: macos-latest +# npm: darwin-arm64 +# - target: x86_64-unknown-linux-gnu +# - target: x86_64-unknown-linux-musl +# npm: linux-x64 +# - target: x86_64-apple-darwin +# os: macos-latest +# npm: darwin-x64 +# - target: x86_64-pc-windows-msvc +# os: windows-latest +# npm: windows-x64 +# - target: x86_64-unknown-freebsd + +# permissions: +# contents: write + +# timeout-minutes: 60 +# runs-on: ${{ matrix.os || 'ubuntu-latest' }} +# steps: +# - name: Checkout +# uses: actions/checkout@v4 + +# - name: Install musl-tools +# run: sudo apt update && sudo apt install -y musl-dev musl-tools +# if: matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl' + +# - name: Install Rust Toolchain +# id: toolchain +# uses: dtolnay/rust-toolchain@stable + +# - name: Cache Project +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# shared-key: check-${{ matrix.target }}-${{ matrix.os }} + +# - name: cross-build +# uses: taiki-e/setup-cross-toolchain-action@v1 +# with: +# target: ${{ matrix.target }} + +# - name: crt-static +# run: echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >>"${GITHUB_ENV}" +# if: endsWith(matrix.target, 'windows-msvc') + +# - name: Compile +# run: cargo build -p homestar-runtime --locked --release --target ${{ matrix.target }} + +# - name: Upload Release Artifacts +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ matrix.target }} +# path: target/${{ matrix.target }}/release/homestar* +# if-no-files-found: error + +# - name: Publish Binary in Release +# if: github.event_name == 'release' && github.event.action == 'published' +# uses: taiki-e/upload-rust-binary-action@v1 +# with: +# bin: homestar +# target: ${{ matrix.target }} +# tar: all +# zip: windows +# include: LICENSE,README.md +# token: ${{ secrets.GITHUB_TOKEN }} + +# npm-publish-arch: +# needs: binary-builds +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# include: +# - target: aarch64-unknown-linux-musl +# os: linux +# arch: arm64 +# bin: homestar +# - target: x86_64-unknown-linux-musl +# os: linux +# arch: x64 +# bin: homestar +# - target: aarch64-apple-darwin +# os: darwin +# arch: arm64 +# bin: homestar +# - target: x86_64-apple-darwin +# os: darwin +# arch: x64 +# bin: homestar +# - target: x86_64-pc-windows-msvc +# os: windows +# arch: x64 +# bin: homestar.exe +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v4 + +# - name: Setup Node +# uses: actions/setup-node@v4 +# with: +# node-version: lts/* +# registry-url: "https://registry.npmjs.org" + +# - name: Install cargo-get +# run: cargo install cargo-get + +# - name: Prepare OS/Arch Packages +# shell: bash +# env: +# node_os: ${{ matrix.os }} +# node_arch: ${{ matrix.arch }} +# node_pkg: homestar-${{ matrix.os }}-${{ matrix.arch }} +# run: | +# export node_version=$(cargo get workspace.package.version) +# echo "node_pkg=${node_pkg}" >> "$GITHUB_ENV" +# cd homestar-runtime/npm +# mkdir -p "${node_pkg}/bin" +# envsubst < package-json-arch.tmpl > "${node_pkg}/package.json" + +# - name: Download Build Artifacts +# uses: actions/download-artifact@v4 +# with: +# name: ${{ matrix.target }} +# path: "homestar-runtime/npm/${{ env.node_pkg }}/bin" + +# - name: Publish Arch Packages to Production +# if: github.event_name == 'release' && github.event.action == 'published' +# run: | +# cp homestar-runtime/README.md "homestar-runtime/npm/${{ env.node_pkg }}" +# cd "homestar-runtime/npm/${{ env.node_pkg }}" +# chmod +x bin/${{ matrix.bin }} +# npm publish --access=public +# env: +# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + +# - name: Publish Arch Packages as RC +# if: github.event_name == 'workflow_dispatch' +# run: | +# cp homestar-runtime/README.md "homestar-runtime/npm/${{ env.node_pkg }}" +# cd "homestar-runtime/npm/${{ env.node_pkg }}" +# chmod +x bin/${{ matrix.bin }} +# npm version $(cargo get package.version)-rc.$(date +%s) --git-tag-version false +# npm publish --access public --tag rc +# env: +# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + +# npm-publish-main: +# needs: npm-publish-arch +# runs-on: ubuntu-latest +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v4 + +# - name: Setup Node +# uses: actions/setup-node@v4 +# with: +# node-version: lts/* +# registry-url: "https://registry.npmjs.org" + +# - name: Install cargo get +# run: cargo install cargo-get + +# - name: Publish main package to Production +# if: github.event_name == 'release' && github.event.action == 'published' +# run: | +# export node_version=$(cargo get workspace.package.version) +# cp homestar-runtime/README.md homestar-runtime/npm/base +# cd homestar-runtime/npm +# envsubst < package-json-base.tmpl > "base/package.json" +# cd base +# npm publish --access=public +# env: +# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + +# - name: Publish main package as RC +# if: (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) +# run: | +# export node_version="$(cargo get workspace.package.version)-rc.$(date +%s)" +# cp homestar-runtime/README.md homestar-runtime/npm/base +# cd homestar-runtime/npm +# envsubst < package-json-baserc.tmpl > "base/package.json" +# cd base +# npm publish --access public --tag rc +# env: +# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + +# build-packages: +# needs: binary-builds +# runs-on: ubuntu-latest +# strategy: +# fail-fast: false +# matrix: +# include: +# - target: x86_64-unknown-linux-gnu +# - target: x86_64-unknown-linux-musl +# steps: +# - name: Checkout +# uses: actions/checkout@v4 + +# - name: Install musl-tools +# run: sudo apt update && sudo apt install -y musl-dev musl-tools +# if: matrix.target == 'x86_64-unknown-linux-musl' + +# - name: Install Rust toolchain +# id: toolchain +# uses: dtolnay/rust-toolchain@master +# with: +# toolchain: stable +# targets: ${{ matrix.target }} + +# - name: Override rust-toolchain.toml +# run: rustup override set ${{steps.toolchain.outputs.name}} + +# - name: Install cargo-deb +# uses: taiki-e/cache-cargo-install-action@v1 +# with: +# tool: cargo-deb + +# - name: Install cargo-generate-rpm +# uses: taiki-e/cache-cargo-install-action@v1 +# with: +# tool: cargo-generate-rpm + +# - name: Cache Project +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# shared-key: check-${{ matrix.target }}-ubuntu-latest + +# - name: Create .deb +# run: cargo deb -p homestar-runtime --target ${{ matrix.target }} --variant ${{ matrix.target }} --output homestar-${{ matrix.target }}.deb + +# - name: Create .rpm +# run: cargo generate-rpm -p homestar-runtime --target ${{ matrix.target }} --variant ${{ matrix.target }} --output homestar-${{ matrix.target }}.rpm + +# - name: Upload Release Artifacts +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ matrix.target }}-packages +# path: | +# *.deb +# *.rpm +# if-no-files-found: error + +# - name: Publish Package in Release +# uses: softprops/action-gh-release@v1 +# if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' && github.event.action == 'published' +# with: +# files: | +# *.deb +# *.rpm + +# docker-build: +# if: > +# startsWith(github.event.release.name, 'homestar-runtime') || +# (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) +# runs-on: ubuntu-latest +# env: +# DOCKER_BUILDKIT: "1" +# REGISTRY: ghcr.io +# IMAGE_NAME: ${{ github.repository }} + +# permissions: +# contents: read +# id-token: write +# packages: write + +# steps: +# - name: Checkout +# uses: actions/checkout@v4 + +# - name: Cleanup +# run: | +# # Workaround to provide additional free space for testing. +# # https://github.com/actions/virtual-environments/issues/2840 +# rm -rf /opt/hostedtoolcache +# rm -rf /usr/share/dotnet +# rm -rf /opt/ghc +# rm -rf "$AGENT_TOOLSDIRECTORY" +# sudo apt-get clean +# sudo rm -rf /usr/share/dotnet + +# - name: Install cargo-get +# if: (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) +# run: cargo install cargo-get + +# - name: Set Current Version +# if: (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) +# id: crate-version +# run: echo version=$(cargo get workspace.package.version)-rc.$(date +%s) >> $GITHUB_OUTPUT + +# - name: Set Env +# run: | +# echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV +# echo "GIT_TIMESTAMP=$(git log -1 --pretty=format:'%cI')" >> $GITHUB_ENV + +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v3 +# with: +# registry: ${{ env.REGISTRY }} +# username: ${{ github.repository_owner }} +# password: ${{ secrets.GITHUB_TOKEN }} + +# - name: Setup QEMU +# uses: docker/setup-qemu-action@v3 + +# - name: Setup Buildx +# uses: docker/setup-buildx-action@v3 + +# - name: Metadata +# if: github.event_name != 'workflow_dispatch' +# id: meta-release +# uses: docker/metadata-action@v5 +# with: +# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} +# tags: | +# type=semver,pattern={{version}} +# type=semver,pattern={{major}}.{{minor}} +# type=raw,value=latest +# type=sha + +# - name: Metadata +# if: (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) +# id: meta-dispatch +# uses: docker/metadata-action@v5 +# with: +# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} +# tags: | +# type=semver,pattern={{version}},value=${{ steps.crate-version.outputs.version }} +# type=raw,value=latest +# type=sha + +# - name: Docker Build & Push +# if: github.event_name != 'workflow_dispatch' +# uses: docker/build-push-action@v5 +# with: +# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest +# cache-to: type=inline +# file: docker/Dockerfile +# context: . +# platforms: linux/amd64,linux/arm64 +# build-args: | +# git_sha=${{ env.GIT_SHA }} +# git_timestamp=${{ env.GIT_TIMESTAMP }} +# push: true +# tags: ${{ steps.meta-release.outputs.tags }} +# labels: ${{ steps.meta-release.outputs.labels }} + +# - name: Docker Build & Push +# if: (github.event_name == 'workflow_dispatch' && github.event.inputs.force-builds) +# uses: docker/build-push-action@v5 +# with: +# cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest +# cache-to: type=inline +# file: docker/Dockerfile +# context: . +# platforms: linux/amd64,linux/arm64 +# build-args: | +# git_sha=${{ env.GIT_SHA }} +# git_timestamp=${{ env.GIT_TIMESTAMP }} +# push: true +# tags: ${{ steps.meta-dispatch.outputs.tags }} +# labels: ${{ steps.meta-dispatch.outputs.labels }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ea070df6..2f93bff2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -1,90 +1,90 @@ -name: โ˜‚ Code Coverage - -on: - push: - branches: [ main ] - - pull_request: - branches: [ '*' ] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - CARGO_INCREMENTAL: 0 - RUST_BACKTRACE: short - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - -jobs: - changes: - runs-on: ubuntu-latest - permissions: - pull-requests: read - outputs: - rust: ${{ steps.filter.outputs.rust }} - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - rust: - - '**/Cargo.*' - - '**/src/**' - - '**/tests/**' - - '**/config/**' - - '**/build.rs' - - '**/migrations/**' - - '**/fixtures/**' - - coverage: - needs: changes - if: ${{ needs.changes.outputs.rust == 'true' }} - runs-on: ubuntu-latest - steps: - - name: Setup IPFS - uses: ibnesayeed/setup-ipfs@master - with: - run_daemon: false - - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Use mold-linker - uses: rui314/setup-mold@v1 - - - name: Install Rust Toolchain - id: toolchain - uses: dtolnay/rust-toolchain@nightly - - - name: Override rust-toolchain.toml - run: rustup override set ${{steps.toolchain.outputs.name}} - - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - save-if: ${{ github.event_name == 'push' }} - - - name: Sccache - uses: mozilla-actions/sccache-action@v0.0.4 - - - name: Install cargo-llvm-cov - uses: taiki-e/install-action@cargo-llvm-cov - - - name: Install cargo-nextest - uses: taiki-e/install-action@nextest - - - name: Generate code coverage (nextest) - run: cargo llvm-cov nextest --all-features --workspace --profile=ci --lcov --output-path lcov.info - - - name: Upload to codecov.io - uses: codecov/codecov-action@v4 - continue-on-error: true - with: - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: false - files: lcov.info +# name: โ˜‚ Code Coverage + +# on: +# push: +# branches: [ main ] + +# pull_request: +# branches: [ '*' ] + +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true + +# env: +# CARGO_INCREMENTAL: 0 +# RUST_BACKTRACE: short +# SCCACHE_GHA_ENABLED: "true" +# RUSTC_WRAPPER: "sccache" + +# jobs: +# changes: +# runs-on: ubuntu-latest +# permissions: +# pull-requests: read +# outputs: +# rust: ${{ steps.filter.outputs.rust }} +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v4 +# - uses: dorny/paths-filter@v3 +# id: filter +# with: +# filters: | +# rust: +# - '**/Cargo.*' +# - '**/src/**' +# - '**/tests/**' +# - '**/config/**' +# - '**/build.rs' +# - '**/migrations/**' +# - '**/fixtures/**' + +# coverage: +# needs: changes +# if: ${{ needs.changes.outputs.rust == 'true' }} +# runs-on: ubuntu-latest +# steps: +# - name: Setup IPFS +# uses: ibnesayeed/setup-ipfs@master +# with: +# run_daemon: false + +# - name: Checkout Repository +# uses: actions/checkout@v4 + +# - name: Use mold-linker +# uses: rui314/setup-mold@v1 + +# - name: Install Rust Toolchain +# id: toolchain +# uses: dtolnay/rust-toolchain@nightly + +# - name: Override rust-toolchain.toml +# run: rustup override set ${{steps.toolchain.outputs.name}} + +# - name: Cache Project +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# save-if: ${{ github.event_name == 'push' }} + +# - name: Sccache +# uses: mozilla-actions/sccache-action@v0.0.4 + +# - name: Install cargo-llvm-cov +# uses: taiki-e/install-action@cargo-llvm-cov + +# - name: Install cargo-nextest +# uses: taiki-e/install-action@nextest + +# - name: Generate code coverage (nextest) +# run: cargo llvm-cov nextest --all-features --workspace --profile=ci --lcov --output-path lcov.info + +# - name: Upload to codecov.io +# uses: codecov/codecov-action@v4 +# continue-on-error: true +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# fail_ci_if_error: false +# files: lcov.info diff --git a/.github/workflows/dependabot_pr.yaml b/.github/workflows/dependabot_pr.yaml index 3195b668..f9b76fc3 100644 --- a/.github/workflows/dependabot_pr.yaml +++ b/.github/workflows/dependabot_pr.yaml @@ -1,47 +1,47 @@ -name: ๐Ÿค– Dependabot PR - -on: - pull_request_target: - branches: - - main - -permissions: - contents: write - pull-requests: write - -jobs: - dependabot: - runs-on: ubuntu-latest - if: ${{ github.actor == 'dependabot[bot]' }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.DEPENDABOT_UPDATE_TOKEN }} - ref: ${{ github.event.pull_request.head.sha }} - - - name: Install Rust Toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Install cargo-hakari - uses: taiki-e/install-action@v2 - with: - tool: cargo-hakari - - - name: Run cargo-hakari - run: | - cargo hakari generate - - - name: Check for modified files - id: git-check - run: echo modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) >> $GITHUB_OUTPUT - - - name: Push changes - if: steps.git-check.outputs.modified == 'true' - run: | - git config user.name "${GITHUB_ACTOR}" - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git - git commit -am "chore(deps): cargo hakari" - git push --force-with-lease origin HEAD:refs/heads/${{ github.head_ref }} +# name: ๐Ÿค– Dependabot PR + +# on: +# pull_request_target: +# branches: +# - main + +# permissions: +# contents: write +# pull-requests: write + +# jobs: +# dependabot: +# runs-on: ubuntu-latest +# if: ${{ github.actor == 'dependabot[bot]' }} +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# token: ${{ secrets.DEPENDABOT_UPDATE_TOKEN }} +# ref: ${{ github.event.pull_request.head.sha }} + +# - name: Install Rust Toolchain +# uses: dtolnay/rust-toolchain@stable + +# - name: Install cargo-hakari +# uses: taiki-e/install-action@v2 +# with: +# tool: cargo-hakari + +# - name: Run cargo-hakari +# run: | +# cargo hakari generate + +# - name: Check for modified files +# id: git-check +# run: echo modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) >> $GITHUB_OUTPUT + +# - name: Push changes +# if: steps.git-check.outputs.modified == 'true' +# run: | +# git config user.name "${GITHUB_ACTOR}" +# git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" +# git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git +# git commit -am "chore(deps): cargo hakari" +# git push --force-with-lease origin HEAD:refs/heads/${{ github.head_ref }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ad4cc8cf..c9362aff 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,46 +1,46 @@ -name: ๐Ÿณ Docker - -on: - schedule: - - cron: "0 */4 * * *" - -jobs: - build-docker: - runs-on: ubuntu-latest - - env: - DOCKER_BUILDKIT: 1 - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Set Env - run: | - echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - echo "GIT_TIMESTAMP=$(git log -1 --pretty=format:'%cI')" >> $GITHUB_ENV - - # https://github.com/docker/setup-qemu-action - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - # https://github.com/docker/setup-buildx-action - - name: Setup Buildx - uses: docker/setup-buildx-action@v3 - with: - buildkitd-flags: "--debug" - - - name: Docker Build - uses: docker/build-push-action@v5 - with: - cache-from: type=gha - cache-to: type=gha,mode=max - file: docker/Dockerfile - context: . - platforms: linux/amd64 - build-args: | - git_sha=${{ env.GIT_SHA }} - git_timestamp=${{ env.GIT_TIMESTAMP }} - push: false - tags: | - ${{ github.repository_owner }}/homestar:latest +# name: ๐Ÿณ Docker + +# on: +# schedule: +# - cron: "0 */4 * * *" + +# jobs: +# build-docker: +# runs-on: ubuntu-latest + +# env: +# DOCKER_BUILDKIT: 1 + +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v4 + +# - name: Set Env +# run: | +# echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV +# echo "GIT_TIMESTAMP=$(git log -1 --pretty=format:'%cI')" >> $GITHUB_ENV + +# # https://github.com/docker/setup-qemu-action +# - name: Setup QEMU +# uses: docker/setup-qemu-action@v3 + +# # https://github.com/docker/setup-buildx-action +# - name: Setup Buildx +# uses: docker/setup-buildx-action@v3 +# with: +# buildkitd-flags: "--debug" + +# - name: Docker Build +# uses: docker/build-push-action@v5 +# with: +# cache-from: type=gha +# cache-to: type=gha,mode=max +# file: docker/Dockerfile +# context: . +# platforms: linux/amd64 +# build-args: | +# git_sha=${{ env.GIT_SHA }} +# git_timestamp=${{ env.GIT_TIMESTAMP }} +# push: false +# tags: | +# ${{ github.repository_owner }}/homestar:latest diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index b40c63f8..77eaab0a 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -1,59 +1,59 @@ -name: ๐Ÿ“ฆ Nix Build - -on: - push: - branches: [main] - - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - changes: - runs-on: ubuntu-latest - permissions: - pull-requests: read - outputs: - nix: ${{ steps.filter.outputs.nix }} - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - nix: - - 'flake.nix' - - 'flake.lock' - - run-checks: - needs: changes - if: ${{ needs.changes.outputs.nix == 'true' }} - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v9 - - - name: Cache Magic - uses: DeterminateSystems/magic-nix-cache-action@v3 - - - name: Check Nix flake inputs - uses: DeterminateSystems/flake-checker-action@v5 - with: - ignore-missing-flake-lock: false - fail-mode: true - - - name: Nix Develop Check - run: | - nix develop --show-trace -c irust --version - nix develop --show-trace -c rustc --version - - - name: Nix Homestar Build - if: ${{ github.event_name == 'push' }} - run: nix build . && ./result/bin/homestar --version +# name: ๐Ÿ“ฆ Nix Build + +# on: +# push: +# branches: [main] + +# pull_request: +# branches: ["**"] + +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true + +# jobs: +# changes: +# runs-on: ubuntu-latest +# permissions: +# pull-requests: read +# outputs: +# nix: ${{ steps.filter.outputs.nix }} +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v4 +# - uses: dorny/paths-filter@v3 +# id: filter +# with: +# filters: | +# nix: +# - 'flake.nix' +# - 'flake.lock' + +# run-checks: +# needs: changes +# if: ${{ needs.changes.outputs.nix == 'true' }} +# runs-on: ubuntu-latest +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v4 + +# - name: Install Nix +# uses: DeterminateSystems/nix-installer-action@v9 + +# - name: Cache Magic +# uses: DeterminateSystems/magic-nix-cache-action@v3 + +# - name: Check Nix flake inputs +# uses: DeterminateSystems/flake-checker-action@v5 +# with: +# ignore-missing-flake-lock: false +# fail-mode: true + +# - name: Nix Develop Check +# run: | +# nix develop --show-trace -c irust --version +# nix develop --show-trace -c rustc --version + +# - name: Nix Homestar Build +# if: ${{ github.event_name == 'push' }} +# run: nix build . && ./result/bin/homestar --version diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1ad9941b..428efbe2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,60 +1,60 @@ -name: ๐Œš Release - -on: - workflow_dispatch: - inputs: - force-publish: - required: true - type: boolean - description: Publish Releases at Anytime - - workflow_run: - workflows: [๐Ÿงช Tests and Checks] - branches: [main] - types: [completed] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - CARGO_INCREMENTAL: 0 - -jobs: - release-plz: - if: > - github.ref == 'refs/heads/main' && - github.repository_owner == 'ipvm-wg' && - (github.event_name == 'workflow_dispatch' && github.event.inputs.force-publish) || github.event.workflow_run.conclusion == 'success' - - runs-on: ubuntu-latest - - permissions: - contents: write - pull-requests: write - - steps: - - name: Generate GitHub token - uses: tibdex/github-app-token@v2 - id: generate-token - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - - - name: Checkout Repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ steps.generate-token.outputs.token }} - - - name: Install Rust Toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Cache Project - uses: Swatinem/rust-cache@v2 - - - name: Run release-plz - uses: MarcoIeni/release-plz-action@v0.5 - env: - GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} +# name: ๐Œš Release + +# on: +# workflow_dispatch: +# inputs: +# force-publish: +# required: true +# type: boolean +# description: Publish Releases at Anytime + +# workflow_run: +# workflows: [๐Ÿงช Tests and Checks] +# branches: [main] +# types: [completed] + +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true + +# env: +# CARGO_INCREMENTAL: 0 + +# jobs: +# release-plz: +# if: > +# github.ref == 'refs/heads/main' && +# github.repository_owner == 'ipvm-wg' && +# (github.event_name == 'workflow_dispatch' && github.event.inputs.force-publish) || github.event.workflow_run.conclusion == 'success' + +# runs-on: ubuntu-latest + +# permissions: +# contents: write +# pull-requests: write + +# steps: +# - name: Generate GitHub token +# uses: tibdex/github-app-token@v2 +# id: generate-token +# with: +# app_id: ${{ secrets.APP_ID }} +# private_key: ${{ secrets.APP_PRIVATE_KEY }} + +# - name: Checkout Repository +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# token: ${{ steps.generate-token.outputs.token }} + +# - name: Install Rust Toolchain +# uses: dtolnay/rust-toolchain@stable + +# - name: Cache Project +# uses: Swatinem/rust-cache@v2 + +# - name: Run release-plz +# uses: MarcoIeni/release-plz-action@v0.5 +# env: +# GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }} +# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/schemas.yml b/.github/workflows/schemas.yml index b50383af..66d3a817 100644 --- a/.github/workflows/schemas.yml +++ b/.github/workflows/schemas.yml @@ -12,7 +12,34 @@ permissions: pull-requests: write jobs: + changes: + runs-on: ubuntu-latest + permissions: + pull-requests: read + outputs: + rust: ${{ steps.filter.outputs.rust }} + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + rust: + - '**/Cargo.*' + - '**/src/**' + - '**/tests/**' + - '**/build.rs' + - '**/migrations/**' + - '**/fixtures/**' + - '**/wit/**' + schemas: + needs: changes + if: ${{ needs.changes.outputs.rust == 'true' }} + env: + SCCACHE_GHA_ENABLED: "true" + RUSTC_WRAPPER: "sccache" runs-on: ubuntu-latest steps: - name: Checkout @@ -21,6 +48,22 @@ jobs: fetch-depth: 0 token: ${{ secrets.HOMESTAR_UPDATE_TOKEN }} ref: ${{ github.event.pull_request.head.sha }} + - uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + examples: + - 'examples/**' + rust: + - '**/Cargo.*' + - '**/src/**' + - '**/tests/**' + - '**/build.rs' + - '**/migrations/**' + - '**/fixtures/**' + - '**/wit/**' + deny: + - 'deny.toml' - name: Install Rust Toolchain uses: dtolnay/rust-toolchain@stable diff --git a/.github/workflows/tests_and_checks.yml b/.github/workflows/tests_and_checks.yml index 23ca9de8..d05cdba4 100644 --- a/.github/workflows/tests_and_checks.yml +++ b/.github/workflows/tests_and_checks.yml @@ -1,366 +1,366 @@ -name: ๐Ÿงช Tests and Checks - -on: - push: - branches: [main] - - pull_request: - branches: ["**"] - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - CARGO_INCREMENTAL: 0 - RUST_BACKTRACE: short - -jobs: - changes: - runs-on: ubuntu-latest - permissions: - pull-requests: read - outputs: - examples: ${{ steps.filter.outputs.examples }} - rust: ${{ steps.filter.outputs.rust }} - deny: ${{ steps.filter.outputs.deny }} - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - examples: - - 'examples/**' - rust: - - '**/Cargo.*' - - '**/src/**' - - '**/tests/**' - - '**/build.rs' - - '**/migrations/**' - - '**/fixtures/**' - - '**/wit/**' - deny: - - 'deny.toml' - - run-checks: - needs: changes - if: ${{ needs.changes.outputs.rust == 'true' }} - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-14, windows-latest] - rust-toolchain: [stable, nightly, 1.73.0] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Use mold-linker - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: rui314/setup-mold@v1 - - - name: Install Rust Toolchain - id: toolchain - uses: dtolnay/rust-toolchain@master - with: - components: rustfmt, clippy - toolchain: ${{ matrix.rust-toolchain }} - - - name: Override rust-toolchain.toml - run: rustup override set ${{steps.toolchain.outputs.name}} - - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: check-${{ matrix.rust-toolchain }}-${{ matrix.os }} - save-if: ${{ github.event_name == 'push' }} - - - name: Sccache - uses: mozilla-actions/sccache-action@v0.0.4 - - - name: Check Format - run: cargo fmt --all -- --check - - - name: Run Linter - run: cargo clippy --all -- -D warnings - continue-on-error: ${{ matrix.rust-toolchain == 'nightly' && matrix.os == 'macos-14' }} - - - name: Install cargo-hakari - if: ${{ matrix.rust-toolchain == 'stable' }} - uses: taiki-e/install-action@v2 - with: - tool: cargo-hakari - - - name: Check workspace-hack Cargo.toml is up-to-date - if: ${{ matrix.rust-toolchain == 'stable' }} - run: cargo hakari generate --diff - - - name: Check Crates Depend on workspace-hack - if: ${{ matrix.rust-toolchain == 'stable' }} - run: cargo hakari manage-deps --dry-run - - # Only "test" release build on push event. - - name: Test Release - if: ${{ matrix.rust-toolchain == 'stable' && github.event_name == 'push' }} - run: cargo build --workspace --release - - run-deny: - needs: changes - if: ${{ needs.changes.outputs.rust == 'true' || needs.changes.outputs.examples == 'true' || needs.changes.outputs.deny == 'true' }} - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Use mold-linker - uses: rui314/setup-mold@v1 - - - name: Install Rust Toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: run-deny-stable-ubuntu-latest - save-if: ${{ github.event_name == 'push' }} - - # Check for security advisories - - name: Check Advisories - uses: EmbarkStudios/cargo-deny-action@v1 - with: - command: check advisories - continue-on-error: true - - # Audit licenses, unreleased crates, and unexpected duplicate versions. - - name: Check Bans, Licenses, and Sources - uses: EmbarkStudios/cargo-deny-action@v1 - with: - command: check bans licenses sources - - run-tests: - needs: changes - if: ${{ needs.changes.outputs.rust == 'true' }} - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-13] - rust-toolchain: [stable, nightly] - default-features: [all, none] - runs-on: ${{ matrix.os }} - steps: - - name: Setup IPFS - uses: ibnesayeed/setup-ipfs@master - with: - run_daemon: false - - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Use mold-linker - if: ${{ matrix.os == 'ubuntu-latest' }} - uses: rui314/setup-mold@v1 - - - name: Install Rust Toolchain - id: toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust-toolchain }} - - - name: Override rust-toolchain.toml - run: rustup override set ${{steps.toolchain.outputs.name}} - - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: test-all-${{ matrix.rust-toolchain }}-${{ matrix.os }} - save-if: ${{ github.event_name == 'push' }} - - - name: Sccache - uses: mozilla-actions/sccache-action@v0.0.4 - - - name: Install nextest - uses: taiki-e/install-action@nextest - - - name: Run Tests (all-features) - if: ${{ matrix.default-features == 'all' }} - run: cargo nextest run --workspace --profile ci --all-features - continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} - - - name: Run Tests (no-default-features) - if: ${{ matrix.default-features == 'none' }} - run: cargo nextest run --profile ci --no-default-features --features "test-utils" - continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} - - - name: Run Doc Tests - if: ${{ matrix.default-features == 'all' }} - run: cargo test --doc --workspace - continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} - - run-tests-windows: - needs: changes - if: ${{ needs.changes.outputs.rust == 'true' }} - env: - RUSTFLAGS: -Dwarnings -Ctarget-feature=+crt-static - strategy: - fail-fast: false - matrix: - rust-toolchain: [stable, nightly] - default-features: [all, none] - runs-on: windows-latest - steps: - - name: Setup IPFS - uses: ibnesayeed/setup-ipfs@master - with: - run_daemon: false - - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Install Rust Toolchain - id: toolchain - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust-toolchain }} - - - name: Override rust-toolchain.toml - run: rustup override set ${{steps.toolchain.outputs.name}} - - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: test-all-${{ matrix.rust-toolchain }}-windows-latest - save-if: ${{ github.event_name == 'push' }} - - - name: Install nextest - uses: taiki-e/install-action@nextest - - - name: Run Tests (all-features) - if: ${{ matrix.default-features == 'all' }} - run: cargo nextest run --workspace --profile ci --all-features - continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} - - - name: Run Tests (no-default-features) - if: ${{ matrix.default-features == 'none' }} - run: cargo nextest run --profile ci --no-default-features --features "test-utils" - continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} - - - name: Run Doc Tests - if: ${{ matrix.default-features == 'all' }} - run: cargo test --doc --workspace - continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} - - run-cargo-tests: - needs: changes - if: ${{ needs.changes.outputs.rust == 'true' }} - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - runs-on: ubuntu-latest - steps: - - name: Setup IPFS - uses: ibnesayeed/setup-ipfs@master - with: - run_daemon: false - - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Install Rust Toolchain - id: toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: test-all-stable-ubuntu-latest - save-if: ${{ github.event_name == 'push' }} - - - name: Sccache - uses: mozilla-actions/sccache-action@v0.0.3 - - - name: Run Tests (all-features) - run: cargo test --workspace --all-features - - run-docs: - needs: [changes] - if: ${{ needs.changes.outputs.rust == 'true' }} - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Use mold-linker - uses: rui314/setup-mold@v1 - - - name: Install Rust Toolchain - uses: dtolnay/rust-toolchain@stable - - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: doc - save-if: ${{ github.event_name == 'push' }} - - - name: Sccache - uses: mozilla-actions/sccache-action@v0.0.4 - - - name: Run Doc(s) compilation - env: - RUSTDOCFLAGS: -Dwarnings - run: cargo doc --workspace --document-private-items - - build-and-run-examples: - needs: changes - if: ${{ needs.changes.outputs.examples == 'true' }} - env: - SCCACHE_GHA_ENABLED: "true" - RUSTC_WRAPPER: "sccache" - runs-on: ubuntu-latest - steps: - - name: Setup IPFS - uses: ibnesayeed/setup-ipfs@master - with: - run_daemon: false - - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Use mold-linker - uses: rui314/setup-mold@v1 - - - name: Install Rust Toolchain - uses: dtolnay/rust-toolchain@nightly - - - name: Cache Project - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - shared-key: cargo-examples - save-if: ${{ github.event_name == 'push' }} - - - name: Sccache - uses: mozilla-actions/sccache-action@v0.0.3 - - - name: Build example-websocket-relay - run: cargo build -p websocket-relay - - - name: Run example-websocket-relay - shell: bash - run: timeout 10s cargo run -p websocket-relay || true +# name: ๐Ÿงช Tests and Checks + +# on: +# push: +# branches: [main] + +# pull_request: +# branches: ["**"] + +# concurrency: +# group: ${{ github.workflow }}-${{ github.ref }} +# cancel-in-progress: true + +# env: +# CARGO_INCREMENTAL: 0 +# RUST_BACKTRACE: short + +# jobs: +# changes: +# runs-on: ubuntu-latest +# permissions: +# pull-requests: read +# outputs: +# examples: ${{ steps.filter.outputs.examples }} +# rust: ${{ steps.filter.outputs.rust }} +# deny: ${{ steps.filter.outputs.deny }} +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v4 +# - uses: dorny/paths-filter@v3 +# id: filter +# with: +# filters: | +# examples: +# - 'examples/**' +# rust: +# - '**/Cargo.*' +# - '**/src/**' +# - '**/tests/**' +# - '**/build.rs' +# - '**/migrations/**' +# - '**/fixtures/**' +# - '**/wit/**' +# deny: +# - 'deny.toml' + +# run-checks: +# needs: changes +# if: ${{ needs.changes.outputs.rust == 'true' }} +# env: +# SCCACHE_GHA_ENABLED: "true" +# RUSTC_WRAPPER: "sccache" +# strategy: +# fail-fast: false +# matrix: +# os: [ubuntu-latest, macos-14, windows-latest] +# rust-toolchain: [stable, nightly, 1.73.0] +# runs-on: ${{ matrix.os }} +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v4 + +# - name: Use mold-linker +# if: ${{ matrix.os == 'ubuntu-latest' }} +# uses: rui314/setup-mold@v1 + +# - name: Install Rust Toolchain +# id: toolchain +# uses: dtolnay/rust-toolchain@master +# with: +# components: rustfmt, clippy +# toolchain: ${{ matrix.rust-toolchain }} + +# - name: Override rust-toolchain.toml +# run: rustup override set ${{steps.toolchain.outputs.name}} + +# - name: Cache Project +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# shared-key: check-${{ matrix.rust-toolchain }}-${{ matrix.os }} +# save-if: ${{ github.event_name == 'push' }} + +# - name: Sccache +# uses: mozilla-actions/sccache-action@v0.0.4 + +# - name: Check Format +# run: cargo fmt --all -- --check + +# - name: Run Linter +# run: cargo clippy --all -- -D warnings +# continue-on-error: ${{ matrix.rust-toolchain == 'nightly' && matrix.os == 'macos-14' }} + +# - name: Install cargo-hakari +# if: ${{ matrix.rust-toolchain == 'stable' }} +# uses: taiki-e/install-action@v2 +# with: +# tool: cargo-hakari + +# - name: Check workspace-hack Cargo.toml is up-to-date +# if: ${{ matrix.rust-toolchain == 'stable' }} +# run: cargo hakari generate --diff + +# - name: Check Crates Depend on workspace-hack +# if: ${{ matrix.rust-toolchain == 'stable' }} +# run: cargo hakari manage-deps --dry-run + +# # Only "test" release build on push event. +# - name: Test Release +# if: ${{ matrix.rust-toolchain == 'stable' && github.event_name == 'push' }} +# run: cargo build --workspace --release + +# run-deny: +# needs: changes +# if: ${{ needs.changes.outputs.rust == 'true' || needs.changes.outputs.examples == 'true' || needs.changes.outputs.deny == 'true' }} +# runs-on: ubuntu-latest +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v4 + +# - name: Use mold-linker +# uses: rui314/setup-mold@v1 + +# - name: Install Rust Toolchain +# uses: dtolnay/rust-toolchain@stable + +# - name: Cache Project +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# shared-key: run-deny-stable-ubuntu-latest +# save-if: ${{ github.event_name == 'push' }} + +# # Check for security advisories +# - name: Check Advisories +# uses: EmbarkStudios/cargo-deny-action@v1 +# with: +# command: check advisories +# continue-on-error: true + +# # Audit licenses, unreleased crates, and unexpected duplicate versions. +# - name: Check Bans, Licenses, and Sources +# uses: EmbarkStudios/cargo-deny-action@v1 +# with: +# command: check bans licenses sources + +# run-tests: +# needs: changes +# if: ${{ needs.changes.outputs.rust == 'true' }} +# env: +# SCCACHE_GHA_ENABLED: "true" +# RUSTC_WRAPPER: "sccache" +# strategy: +# fail-fast: false +# matrix: +# os: [ubuntu-latest, macos-13] +# rust-toolchain: [stable, nightly] +# default-features: [all, none] +# runs-on: ${{ matrix.os }} +# steps: +# - name: Setup IPFS +# uses: ibnesayeed/setup-ipfs@master +# with: +# run_daemon: false + +# - name: Checkout Repository +# uses: actions/checkout@v4 + +# - name: Use mold-linker +# if: ${{ matrix.os == 'ubuntu-latest' }} +# uses: rui314/setup-mold@v1 + +# - name: Install Rust Toolchain +# id: toolchain +# uses: dtolnay/rust-toolchain@master +# with: +# toolchain: ${{ matrix.rust-toolchain }} + +# - name: Override rust-toolchain.toml +# run: rustup override set ${{steps.toolchain.outputs.name}} + +# - name: Cache Project +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# shared-key: test-all-${{ matrix.rust-toolchain }}-${{ matrix.os }} +# save-if: ${{ github.event_name == 'push' }} + +# - name: Sccache +# uses: mozilla-actions/sccache-action@v0.0.4 + +# - name: Install nextest +# uses: taiki-e/install-action@nextest + +# - name: Run Tests (all-features) +# if: ${{ matrix.default-features == 'all' }} +# run: cargo nextest run --workspace --profile ci --all-features +# continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} + +# - name: Run Tests (no-default-features) +# if: ${{ matrix.default-features == 'none' }} +# run: cargo nextest run --profile ci --no-default-features --features "test-utils" +# continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} + +# - name: Run Doc Tests +# if: ${{ matrix.default-features == 'all' }} +# run: cargo test --doc --workspace +# continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} + +# run-tests-windows: +# needs: changes +# if: ${{ needs.changes.outputs.rust == 'true' }} +# env: +# RUSTFLAGS: -Dwarnings -Ctarget-feature=+crt-static +# strategy: +# fail-fast: false +# matrix: +# rust-toolchain: [stable, nightly] +# default-features: [all, none] +# runs-on: windows-latest +# steps: +# - name: Setup IPFS +# uses: ibnesayeed/setup-ipfs@master +# with: +# run_daemon: false + +# - name: Checkout Repository +# uses: actions/checkout@v4 + +# - name: Install Rust Toolchain +# id: toolchain +# uses: dtolnay/rust-toolchain@master +# with: +# toolchain: ${{ matrix.rust-toolchain }} + +# - name: Override rust-toolchain.toml +# run: rustup override set ${{steps.toolchain.outputs.name}} + +# - name: Cache Project +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# shared-key: test-all-${{ matrix.rust-toolchain }}-windows-latest +# save-if: ${{ github.event_name == 'push' }} + +# - name: Install nextest +# uses: taiki-e/install-action@nextest + +# - name: Run Tests (all-features) +# if: ${{ matrix.default-features == 'all' }} +# run: cargo nextest run --workspace --profile ci --all-features +# continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} + +# - name: Run Tests (no-default-features) +# if: ${{ matrix.default-features == 'none' }} +# run: cargo nextest run --profile ci --no-default-features --features "test-utils" +# continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} + +# - name: Run Doc Tests +# if: ${{ matrix.default-features == 'all' }} +# run: cargo test --doc --workspace +# continue-on-error: ${{ matrix.rust-toolchain == 'nightly' }} + +# run-cargo-tests: +# needs: changes +# if: ${{ needs.changes.outputs.rust == 'true' }} +# env: +# SCCACHE_GHA_ENABLED: "true" +# RUSTC_WRAPPER: "sccache" +# runs-on: ubuntu-latest +# steps: +# - name: Setup IPFS +# uses: ibnesayeed/setup-ipfs@master +# with: +# run_daemon: false + +# - name: Checkout Repository +# uses: actions/checkout@v4 + +# - name: Install Rust Toolchain +# id: toolchain +# uses: dtolnay/rust-toolchain@stable + +# - name: Cache Project +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# shared-key: test-all-stable-ubuntu-latest +# save-if: ${{ github.event_name == 'push' }} + +# - name: Sccache +# uses: mozilla-actions/sccache-action@v0.0.3 + +# - name: Run Tests (all-features) +# run: cargo test --workspace --all-features + +# run-docs: +# needs: [changes] +# if: ${{ needs.changes.outputs.rust == 'true' }} +# env: +# SCCACHE_GHA_ENABLED: "true" +# RUSTC_WRAPPER: "sccache" +# runs-on: ubuntu-latest +# steps: +# - name: Checkout Repository +# uses: actions/checkout@v4 + +# - name: Use mold-linker +# uses: rui314/setup-mold@v1 + +# - name: Install Rust Toolchain +# uses: dtolnay/rust-toolchain@stable + +# - name: Cache Project +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# shared-key: doc +# save-if: ${{ github.event_name == 'push' }} + +# - name: Sccache +# uses: mozilla-actions/sccache-action@v0.0.4 + +# - name: Run Doc(s) compilation +# env: +# RUSTDOCFLAGS: -Dwarnings +# run: cargo doc --workspace --document-private-items + +# build-and-run-examples: +# needs: changes +# if: ${{ needs.changes.outputs.examples == 'true' }} +# env: +# SCCACHE_GHA_ENABLED: "true" +# RUSTC_WRAPPER: "sccache" +# runs-on: ubuntu-latest +# steps: +# - name: Setup IPFS +# uses: ibnesayeed/setup-ipfs@master +# with: +# run_daemon: false + +# - name: Checkout Repository +# uses: actions/checkout@v4 + +# - name: Use mold-linker +# uses: rui314/setup-mold@v1 + +# - name: Install Rust Toolchain +# uses: dtolnay/rust-toolchain@nightly + +# - name: Cache Project +# uses: Swatinem/rust-cache@v2 +# with: +# cache-on-failure: true +# shared-key: cargo-examples +# save-if: ${{ github.event_name == 'push' }} + +# - name: Sccache +# uses: mozilla-actions/sccache-action@v0.0.3 + +# - name: Build example-websocket-relay +# run: cargo build -p websocket-relay + +# - name: Run example-websocket-relay +# shell: bash +# run: timeout 10s cargo run -p websocket-relay || true diff --git a/homestar-schemas/src/main.rs b/homestar-schemas/src/main.rs index b1b640ba..28219977 100644 --- a/homestar-schemas/src/main.rs +++ b/homestar-schemas/src/main.rs @@ -119,7 +119,7 @@ fn generate_api_doc( summary: None, servers: None, tags: None, - param_structure: Some(MethodObjectParamStructure::ByName), + param_structure: Some(MethodObjectParamStructure::Either), params: vec![], result: ContentDescriptorOrReference::ContentDescriptorObject(ContentDescriptorObject { name: "health".to_string(),