name: CI
on:
push:
branches:
- main
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Reject insecure workflow installers
shell: bash
run: |
forbidden_patterns=(
'curl[[:space:]].*\|[[:space:]]*sh'
'sh\.rustup\.rs'
'\|[[:space:]]*iex'
)
for pattern in "${forbidden_patterns[@]}"; do
if find .github/workflows -type f \( -name '*.yml' -o -name '*.yaml' \) -exec grep -En -- "$pattern" {} +; then
echo "forbidden workflow pattern detected: $pattern" >&2
exit 1
fi
done
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.88.0
with:
components: rustfmt, clippy
- name: Check formatting
run: cargo fmt --all --check
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Enforce file length limits
run: python3 scripts/check_file_lengths.py
- name: Run tests
run: cargo test
- name: Verify publish package
run: cargo publish --dry-run --locked
- name: List packaged files
run: cargo package --list
rust-macos:
runs-on: macos-15
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.88.0
with:
components: rustfmt, clippy
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test
menubar-app:
runs-on: macos-15
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Build menu bar app
run: |
xcodebuild \
-project macos/ClipmemMenuBar/ClipmemMenuBar.xcodeproj \
-scheme ClipmemMenuBar \
-configuration Debug \
-destination 'platform=macOS' \
-derivedDataPath /tmp/clipmem-menubar-ci-build-derived \
CODE_SIGNING_ALLOWED=NO \
build
- name: Test menu bar app
run: |
xcodebuild \
-project macos/ClipmemMenuBar/ClipmemMenuBar.xcodeproj \
-scheme ClipmemMenuBar \
-configuration Debug \
-destination 'platform=macOS' \
-derivedDataPath /tmp/clipmem-menubar-ci-test-derived \
CODE_SIGNING_ALLOWED=NO \
test