diff --git a/.github/workflows/rocky.yml b/.github/workflows/rocky.yml deleted file mode 100644 index b60ec330..00000000 --- a/.github/workflows/rocky.yml +++ /dev/null @@ -1,117 +0,0 @@ -name: Rocky and Mariner - -on: - push: - tags: - - "20*" - branches: [ "main" ] - paths: - - "crates/**/*.rs" - - ".github/workflows/rocky.yml" - - "**/Cargo.toml" - - "get-deps.sh" - - "assets/build-rpm.sh" - - "assets/sign-rpm.sh" - - "assets/policy-extras/**" - - "assets/bounce_classifier/**" - - "assets/upload-package.sh" - - pull_request: - branches: [ "main" ] - paths: - - "crates/**/*.rs" - - ".github/workflows/rocky.yml" - - "**/Cargo.toml" - - "get-deps.sh" - - "assets/build-rpm.sh" - - "assets/sign-rpm.sh" - - "assets/policy-extras/**" - - "assets/bounce_classifier/**" - - "assets/upload-package.sh" - -env: - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - -jobs: - build-rocky: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - container: - - "rockylinux:8" - - "rockylinux:9" - #- "mcr.microsoft.com/cbl-mariner/base/core:2.0" - container: - image: ${{ matrix.container }} - options: --privileged - - steps: - - name: "Install git" - shell: bash - # Mariner uses yum rather than dnf - run: "dnf install -y git || yum install -y git" - - name: "Install Hashicorp Vault" - run: | - dnf install -y yum-utils || yum install -y yum-utils - yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo - dnf install -y vault || yum install -y vault - - name: "Install Rust" - uses: dtolnay/rust-toolchain@stable - - uses: actions/checkout@v3 - - name: workaround git permission guff - run: git config --global --add safe.directory /__w/kumomta/kumomta - - name: Get Deps - run: bash ./get-deps.sh - - name: Install cargo-nextest - uses: baptiste0928/cargo-install@v2 - with: - crate: cargo-nextest - cache-key: ${{ matrix.container }} - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - env-vars: "CARGO RUST" - key: ${{ matrix.container }} - - name: "Show Disk Usage" - run: "./assets/show-disk-space.sh" - - name: Build - run: cargo build --release - - name: "Show Disk Usage" - run: "./assets/show-disk-space.sh" - - name: Run tests - run: cargo nextest run --release - - name: "Show Disk Usage" - run: "./assets/show-disk-space.sh" - - name: Prune Target Dir - run: "./assets/trim-target-dir.sh" - - name: "Show Disk Usage" - run: "./assets/show-disk-space.sh" - - name: "Build RPM" - env: - REF_TYPE: ${{ github.ref_type }} - run: "./assets/build-rpm.sh" - - name: "Move RPM" - run: "mv ~/rpmbuild/RPMS/*/*.rpm ." - - name: "Sign" - if: ${{ github.ref == 'refs/heads/main' || github.ref_type == 'tag' }} - env: - PUB: ${{ secrets.OPENREPO_GPG_PUBLIC }} - PRIV: ${{ secrets.OPENREPO_GPG_PRIVATE }} - TOKEN: ${{ secrets.OPENREPO_API_TOKEN }} - REF_TYPE: ${{ github.ref_type }} - shell: bash - run: | - ./assets/sign-rpm.sh *.rpm - ./assets/upload-package.sh ${{ matrix.container }} *.rpm - - name: Make artifact name - id: artifact-name - run: echo "name=${{ matrix.container }}" | tr ':' '-' >> $GITHUB_OUTPUT - - name: "Upload artifact" - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.artifact-name.outputs.name }} - path: "*.rpm" - - diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 9b1edd89..00000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Rust - -on: - push: - branches: [ "main" ] - paths: - - "crates/**/*.rs" - - ".github/workflows/rust.yml" - - "**/Cargo.toml" - - "Cargo.lock" # for dependabot updates - - pull_request: - branches: [ "main" ] - paths: - - "crates/**/*.rs" - - ".github/workflows/rust.yml" - - "**/Cargo.toml" - -env: - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - -jobs: - build-rust: - - runs-on: ubuntu-latest - - steps: - - name: Maximize build space - uses: easimon/maximize-build-space@master - with: - root-reserve-mb: 512 - swap-size-mb: 1024 - remove-dotnet: 'true' - remove-android: 'true' - remove-haskell: 'true' - remove-codeql: 'true' - remove-docker-images: 'false' - - name: "Update APT" - shell: bash - run: "sudo apt update" - - name: "Install more deps" - shell: bash - run: "sudo apt-get install -y redis" - - uses: actions/checkout@v3 - - name: Install cargo-nextest - uses: baptiste0928/cargo-install@v2 - with: - crate: cargo-nextest - - name: Build (Release) - run: cargo build --verbose --release - - name: Run tests - run: cargo nextest run --release diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml deleted file mode 100644 index 30f13fc3..00000000 --- a/.github/workflows/ubuntu.yml +++ /dev/null @@ -1,118 +0,0 @@ -name: Ubuntu LTS - -on: - push: - tags: - - "20*" - branches: [ "main" ] - paths: - - "crates/**/*.rs" - - ".github/workflows/ubuntu.yml" - - "get-deps.sh" - - "assets/upload-package.sh" - - "assets/build-deb.sh" - - "assets/policy-extras/**" - - "assets/bounce_classifier/**" - - "**/Cargo.toml" - - pull_request: - branches: [ "main" ] - paths: - - "crates/**/*.rs" - - ".github/workflows/ubuntu.yml" - - "get-deps.sh" - - "assets/upload-package.sh" - - "assets/build-deb.sh" - - "assets/policy-extras/**" - - "assets/bounce_classifier/**" - - "**/Cargo.toml" - -env: - CARGO_TERM_COLOR: always - CARGO_INCREMENTAL: 0 - -jobs: - build-ubuntu: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - container: ["ubuntu:20.04", "ubuntu:22.04"] - - container: - image: ${{ matrix.container }} - options: --privileged - - steps: - - name: "set APT to non-interactive" - shell: bash - run: "echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections" - - name: "Update APT" - shell: bash - run: "apt update" - - name: "Install git" - shell: bash - run: "apt-get install -y git" - - name: "Install more deps" - shell: bash - # some build stuff is needed to support cargo install used below - run: "apt-get install -y curl gcc g++" - - name: "Update APT" - shell: bash - run: "apt update" - - name: "Install Hashicorp Vault" - run: | - apt-get install -y gpg lsb-release - curl -fsSL https://apt.releases.hashicorp.com/gpg | gpg --yes --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg - echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list - apt update - apt install -y vault - - name: "Install Rust" - uses: dtolnay/rust-toolchain@stable - - uses: actions/checkout@v3 - - name: workaround git permission guff - run: git config --global --add safe.directory /__w/kumomta/kumomta - - name: Get Deps - run: bash ./get-deps.sh - - name: "Show Disk Usage" - run: "./assets/show-disk-space.sh" - - name: Install cargo-nextest - uses: baptiste0928/cargo-install@v2 - with: - crate: cargo-nextest - cache-key: ${{ matrix.container }} - - name: Build - run: cargo build --release - - name: "Show Disk Usage" - run: "./assets/show-disk-space.sh" - - name: Run tests - run: cargo nextest run --release - - name: "Show Disk Usage" - run: "./assets/show-disk-space.sh" - - name: Prune Target Dir - run: "./assets/trim-target-dir.sh" - - name: "Show Disk Usage" - run: "./assets/show-disk-space.sh" - - name: Build Package - env: - REF_TYPE: ${{ github.ref_type }} - run: "./assets/build-deb.sh" - - name: Verify Package is installable - run: "apt-get install ./kumomta*.deb" - - name: Make artifact name - id: artifact-name - run: echo "name=${{ matrix.container }}" | tr ':' '-' >> $GITHUB_OUTPUT - - name: "Upload artifact" - uses: actions/upload-artifact@v3 - with: - name: ${{ steps.artifact-name.outputs.name }} - path: "kumomta*.deb" - - name: "Publish" - if: ${{ github.ref == 'refs/heads/main' || github.ref_type == 'tag' }} - env: - TOKEN: ${{ secrets.OPENREPO_API_TOKEN }} - REF_TYPE: ${{ github.ref_type }} - shell: bash - run: | - ./assets/upload-package.sh ${{ matrix.container }} kumomta*.deb -