Skip to content

docs: Apple Gatekeeper #3

docs: Apple Gatekeeper

docs: Apple Gatekeeper #3

Workflow file for this run

name: Smoke
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: smoke-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
smoke:
name: Smoke test against EU API
runs-on: ubuntu-latest
env:
ATTACHMENTAV_API_KEY: ${{ secrets.ATTACHMENTAV_API_KEY }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build release binary
run: cargo build --release --locked
- name: Verify --help
run: ./target/release/attachmentav --help
- name: Scan clean input via stdin
shell: bash
run: |
set -euo pipefail
output=$(printf 'hello attachmentav smoke test' | ./target/release/attachmentav)
echo "output: $output"
[ "$output" = "clean" ]
- name: Scan EICAR via stdin
shell: bash
run: |
set +e
output=$(printf 'X5O!P%%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' | ./target/release/attachmentav)
rc=$?
set -e
echo "output: $output"
echo "exit: $rc"
if [ "$rc" -ne 1 ]; then
echo "expected exit 1 (infected), got $rc"
exit 1
fi
case "$output" in
infected:*) ;;
*) echo "expected output to start with 'infected:', got: $output"; exit 1 ;;
esac