mirror of
https://github.com/chatmail/relay.git
synced 2026-09-17 04:40:08 +00:00
chore: integrate filtermail's .github directory into relay's
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: "cargo"
|
- package-ecosystem: "cargo"
|
||||||
directory: "/"
|
directory: "/filtermail"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "monthly"
|
interval: "monthly"
|
||||||
cooldown:
|
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:
|
on:
|
||||||
# Triggers when a PR is merged into main or a direct push occurs
|
# Triggers when a PR is merged into main or a direct push occurs
|
||||||
@@ -18,24 +18,8 @@ concurrency:
|
|||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tox:
|
cmdeploy:
|
||||||
name: isolated chatmaild tests
|
name: cmdeploy 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
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
@@ -61,6 +45,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cmlxc_version: main
|
cmlxc_version: main
|
||||||
cmlxc_commands: |
|
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
|
cmlxc init
|
||||||
# single cmdeploy relay test
|
# single cmdeploy relay test
|
||||||
cmlxc -v deploy-cmdeploy --source ./repo cm0
|
cmlxc -v deploy-cmdeploy --source ./repo cm0
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name: CI
|
name: filtermail CI
|
||||||
|
|
||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
||||||
@@ -10,6 +10,8 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
paths:
|
||||||
|
- "filtermail/**"
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
@@ -27,11 +29,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
|
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
||||||
- uses: taiki-e/install-action@2ca9b94c269419b7b0c711c09d0b21c4e1d51145 # v2
|
- uses: taiki-e/install-action@2ca9b94c269419b7b0c711c09d0b21c4e1d51145 # v2.83.1
|
||||||
with:
|
with:
|
||||||
tool: taplo-cli
|
tool: taplo-cli
|
||||||
- run: taplo format --check && cargo fmt --check
|
- run: cd filtermail && taplo format --check && cargo fmt --check
|
||||||
|
|
||||||
cargo-machete:
|
cargo-machete:
|
||||||
name: Check Unused Dependencies
|
name: Check Unused Dependencies
|
||||||
@@ -58,8 +60,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: ${{ matrix.toolchain }}
|
toolchain: ${{ matrix.toolchain }}
|
||||||
components: clippy
|
components: clippy
|
||||||
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
|
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
||||||
- run: cargo clippy
|
- run: cd filtermail && cargo clippy
|
||||||
env:
|
env:
|
||||||
RUSTUP_TOOLCHAIN: ${{ matrix.toolchain }}
|
RUSTUP_TOOLCHAIN: ${{ matrix.toolchain }}
|
||||||
|
|
||||||
@@ -73,35 +75,5 @@ jobs:
|
|||||||
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
|
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2
|
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
||||||
- run: cargo test
|
- run: cd filtermail && 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
|
|
||||||
+16
-8
@@ -1,6 +1,9 @@
|
|||||||
on:
|
on:
|
||||||
release:
|
push:
|
||||||
types: [published]
|
tags:
|
||||||
|
- 'filtermail-*'
|
||||||
|
|
||||||
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -14,12 +17,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
targets: aarch64-unknown-linux-musl,x86_64-unknown-linux-musl
|
targets: aarch64-unknown-linux-musl,x86_64-unknown-linux-musl
|
||||||
- uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2
|
- uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2.2.1
|
||||||
- uses: taiki-e/install-action@2ca9b94c269419b7b0c711c09d0b21c4e1d51145 # v2
|
with:
|
||||||
|
use-cache: false
|
||||||
|
- uses: taiki-e/install-action@2ca9b94c269419b7b0c711c09d0b21c4e1d51145 # v2.83.1
|
||||||
with:
|
with:
|
||||||
tool: cargo-zigbuild
|
tool: cargo-zigbuild
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
|
cd filtermail
|
||||||
RUSTFLAGS="-Ctarget-feature=+crt-static -Clink-self-contained=yes" \
|
RUSTFLAGS="-Ctarget-feature=+crt-static -Clink-self-contained=yes" \
|
||||||
cargo zigbuild \
|
cargo zigbuild \
|
||||||
--release \
|
--release \
|
||||||
@@ -29,26 +35,28 @@ jobs:
|
|||||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: filtermail-x86_64
|
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
|
if-no-files-found: error
|
||||||
- name: Upload aarch64 binary
|
- name: Upload aarch64 binary
|
||||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
with:
|
with:
|
||||||
name: filtermail-aarch64
|
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
|
if-no-files-found: error
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
name: Upload binaries to the release
|
name: Upload binaries to the release
|
||||||
needs: ["build"]
|
needs: ["build"]
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Download aarch64 binary
|
- name: Download x86_64 binary
|
||||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||||
with:
|
with:
|
||||||
name: filtermail-x86_64
|
name: filtermail-x86_64
|
||||||
path: filtermail-x86_64
|
path: filtermail-x86_64
|
||||||
- name: Download x86_64 binary
|
- name: Download aarch64 binary
|
||||||
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
||||||
with:
|
with:
|
||||||
name: filtermail-aarch64
|
name: filtermail-aarch64
|
||||||
@@ -78,6 +78,7 @@ docs/_build/
|
|||||||
# PyBuilder
|
# PyBuilder
|
||||||
.pybuilder/
|
.pybuilder/
|
||||||
target/
|
target/
|
||||||
|
filtermail/target/
|
||||||
|
|
||||||
# Jupyter Notebook
|
# Jupyter Notebook
|
||||||
.ipynb_checkpoints
|
.ipynb_checkpoints
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
/target
|
|
||||||
@@ -6,7 +6,7 @@ license = "MIT"
|
|||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
authors = ["Chatmail Developers"]
|
authors = ["Chatmail Developers"]
|
||||||
description = "A mail filtering service used by chatmail relay"
|
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]
|
[dependencies]
|
||||||
async-trait = "0.1.89"
|
async-trait = "0.1.89"
|
||||||
|
|||||||
Reference in New Issue
Block a user