mirror of
https://github.com/chatmail/relay.git
synced 2026-08-11 19:10:52 +00:00
chore: integrate filtermail's .github directory into relay's
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "cargo"
|
||||
directory: "/"
|
||||
directory: "/filtermail"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
cooldown:
|
||||
@@ -0,0 +1,35 @@
|
||||
name: chatmaild CI
|
||||
|
||||
on:
|
||||
# Triggers when a PR is merged into main or a direct push occurs
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
# Triggers for any PR (and its subsequent commits) targeting the main branch
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
permissions: {}
|
||||
|
||||
# Newest push wins: Prevents multiple runs from clashing and wasting runner efforts
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
tox:
|
||||
name: isolated chatmaild tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
# Checkout pull request HEAD commit instead of merge commit
|
||||
# Otherwise `test_deployed_state` will be unhappy.
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
persist-credentials: false
|
||||
- name: download filtermail
|
||||
run: curl -L https://github.com/chatmail/filtermail/releases/download/v0.7.4/filtermail-x86_64 -o /usr/local/bin/filtermail && chmod +x /usr/local/bin/filtermail
|
||||
- name: run chatmaild tests
|
||||
working-directory: chatmaild
|
||||
run: pipx run tox
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: CI
|
||||
name: cmdeploy CI
|
||||
|
||||
on:
|
||||
# Triggers when a PR is merged into main or a direct push occurs
|
||||
@@ -18,24 +18,8 @@ concurrency:
|
||||
|
||||
|
||||
jobs:
|
||||
tox:
|
||||
name: isolated chatmaild tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
# Checkout pull request HEAD commit instead of merge commit
|
||||
# Otherwise `test_deployed_state` will be unhappy.
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
persist-credentials: false
|
||||
- name: download filtermail
|
||||
run: curl -L https://github.com/chatmail/filtermail/releases/download/v0.7.4/filtermail-x86_64 -o /usr/local/bin/filtermail && chmod +x /usr/local/bin/filtermail
|
||||
- name: run chatmaild tests
|
||||
working-directory: chatmaild
|
||||
run: pipx run tox
|
||||
|
||||
scripts:
|
||||
name: deploy-chatmail tests
|
||||
cmdeploy:
|
||||
name: cmdeploy tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
@@ -61,6 +45,10 @@ jobs:
|
||||
with:
|
||||
cmlxc_version: main
|
||||
cmlxc_commands: |
|
||||
sudo apt-get update && sudo apt-get install -y musl-tools
|
||||
rustup target add x86_64-unknown-linux-musl
|
||||
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc
|
||||
cd repo/filtermail && RUSTFLAGS="-Ctarget-feature=+crt-static -Clink-self-contained=yes" cargo build --release --target x86_64-unknown-linux-musl
|
||||
cmlxc init
|
||||
# single cmdeploy relay test
|
||||
cmlxc -v deploy-cmdeploy --source ./repo cm0
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: CI
|
||||
name: filtermail CI
|
||||
|
||||
permissions: {}
|
||||
|
||||
@@ -10,6 +10,8 @@ on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "filtermail/**"
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
@@ -27,11 +29,11 @@ jobs:
|
||||
with:
|
||||
toolchain: nightly
|
||||
components: rustfmt
|
||||
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
|
||||
- uses: taiki-e/install-action@2ca9b94c269419b7b0c711c09d0b21c4e1d51145 # v2
|
||||
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
||||
- uses: taiki-e/install-action@2ca9b94c269419b7b0c711c09d0b21c4e1d51145 # v2.83.1
|
||||
with:
|
||||
tool: taplo-cli
|
||||
- run: taplo format --check && cargo fmt --check
|
||||
- run: cd filtermail && taplo format --check && cargo fmt --check
|
||||
|
||||
cargo-machete:
|
||||
name: Check Unused Dependencies
|
||||
@@ -58,8 +60,8 @@ jobs:
|
||||
with:
|
||||
toolchain: ${{ matrix.toolchain }}
|
||||
components: clippy
|
||||
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
|
||||
- run: cargo clippy
|
||||
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
||||
- run: cd filtermail && cargo clippy
|
||||
env:
|
||||
RUSTUP_TOOLCHAIN: ${{ matrix.toolchain }}
|
||||
|
||||
@@ -73,35 +75,5 @@ jobs:
|
||||
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
|
||||
with:
|
||||
toolchain: stable
|
||||
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
|
||||
- run: cargo test
|
||||
|
||||
relay-test:
|
||||
name: Test the relay with cmlxc and custom filtermail
|
||||
uses: chatmail/cmlxc/.github/workflows/lxc-test.yml@main
|
||||
with:
|
||||
cmlxc_commands: |
|
||||
sudo apt-get update && sudo apt-get install -y musl-tools
|
||||
rustup target add x86_64-unknown-linux-musl
|
||||
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc
|
||||
cd repo && RUSTFLAGS="-Ctarget-feature=+crt-static -Clink-self-contained=yes" cargo build --release --target x86_64-unknown-linux-musl
|
||||
cmlxc init
|
||||
cmlxc -v deploy-cmdeploy --filtermail repo/target/x86_64-unknown-linux-musl/release/filtermail cm0
|
||||
cmlxc -v deploy-cmdeploy --filtermail repo/target/x86_64-unknown-linux-musl/release/filtermail --type ipv4 cm1
|
||||
cmlxc -v deploy-madmail mad0
|
||||
|
||||
# single-relay tests
|
||||
cmlxc -v test-cmdeploy cm0
|
||||
cmlxc -v test-cmdeploy cm1
|
||||
cmlxc -v test-mini cm0
|
||||
cmlxc -v test-mini cm1
|
||||
|
||||
# cross-relay tests (Standard <-> IP-only <-> Madmail)
|
||||
cmlxc -v test-cmdeploy cm0 cm1
|
||||
cmlxc -v test-cmdeploy cm1 cm0
|
||||
cmlxc -v test-cmdeploy cm0 mad0
|
||||
cmlxc -v test-cmdeploy cm1 mad0
|
||||
cmlxc -v test-mini cm0 mad0
|
||||
cmlxc -v test-mini mad0 cm0
|
||||
cmlxc -v test-mini cm1 mad0
|
||||
cmlxc -v test-mini mad0 cm1
|
||||
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
||||
- run: cd filtermail && cargo test
|
||||
+16
-8
@@ -1,6 +1,9 @@
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
push:
|
||||
tags:
|
||||
- 'filtermail-*'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -14,12 +17,15 @@ jobs:
|
||||
with:
|
||||
toolchain: stable
|
||||
targets: aarch64-unknown-linux-musl,x86_64-unknown-linux-musl
|
||||
- uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2
|
||||
- uses: taiki-e/install-action@2ca9b94c269419b7b0c711c09d0b21c4e1d51145 # v2
|
||||
- uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
|
||||
with:
|
||||
use-cache: false
|
||||
- uses: taiki-e/install-action@2ca9b94c269419b7b0c711c09d0b21c4e1d51145 # v2.83.1
|
||||
with:
|
||||
tool: cargo-zigbuild
|
||||
- name: Build
|
||||
run: |
|
||||
cd filtermail
|
||||
RUSTFLAGS="-Ctarget-feature=+crt-static -Clink-self-contained=yes" \
|
||||
cargo zigbuild \
|
||||
--release \
|
||||
@@ -29,26 +35,28 @@ jobs:
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: filtermail-x86_64
|
||||
path: target/x86_64-unknown-linux-musl/release/filtermail
|
||||
path: filtermail/target/x86_64-unknown-linux-musl/release/filtermail
|
||||
if-no-files-found: error
|
||||
- name: Upload aarch64 binary
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
with:
|
||||
name: filtermail-aarch64
|
||||
path: target/aarch64-unknown-linux-musl/release/filtermail
|
||||
path: filtermail/target/aarch64-unknown-linux-musl/release/filtermail
|
||||
if-no-files-found: error
|
||||
|
||||
publish:
|
||||
name: Upload binaries to the release
|
||||
needs: ["build"]
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download aarch64 binary
|
||||
- name: Download x86_64 binary
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
name: filtermail-x86_64
|
||||
path: filtermail-x86_64
|
||||
- name: Download x86_64 binary
|
||||
- name: Download aarch64 binary
|
||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||
with:
|
||||
name: filtermail-aarch64
|
||||
@@ -78,6 +78,7 @@ docs/_build/
|
||||
# PyBuilder
|
||||
.pybuilder/
|
||||
target/
|
||||
filtermail/target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
/target
|
||||
@@ -6,7 +6,7 @@ license = "MIT"
|
||||
readme = "README.md"
|
||||
authors = ["Chatmail Developers"]
|
||||
description = "A mail filtering service used by chatmail relay"
|
||||
repository = "https://github.com/chatmail/filtermail"
|
||||
repository = "https://github.com/chatmail/relay/tree/main/filtermail"
|
||||
|
||||
[dependencies]
|
||||
async-trait = "0.1.89"
|
||||
|
||||
Reference in New Issue
Block a user