name: CI on: push: branches: [ "master" ] pull_request: branches: [ "master" ] env: CARGO_TERM_COLOR: always JUST_VERBOSE: 1 RUSTFLAGS: "--deny warnings" # Fail on all warnings defaults: run: shell: bash jobs: Checks: runs-on: ubuntu-latest env: CARGO_TERM_VERBOSE: true steps: - uses: actions/checkout@v4 - uses: extractions/setup-just@v2 - name: Print Tool versions run: just env - name: run pre-commit run: | pip install pre-commit pre-commit run --all-files - name: Check run: cargo check - name: Clippy run: cargo clippy --all --all-targets --no-deps - name: Check Format run: cargo fmt --all -- --check - name: Check docs run: cargo doc --no-deps - name: Audit run: cargo audit || echo "Vulnerability discovered... update now or when a fix is available" # Lint (check/clippy) of feature combinations - uses: taiki-e/install-action@cargo-hack - name: Check feature combinations run: cargo hack check --feature-powerset --no-dev-deps - name: Clippy feature combinations run: cargo hack clippy --feature-powerset --no-dev-deps - name: Install shellcheck run: sudo apt-get update && sudo apt-get install shellcheck - name: Check Install Script run: shellcheck www/install.sh Test: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] fail-fast: false runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - uses: extractions/setup-just@v2 - name: Print Tool versions (unix) if: ${{ matrix.os != 'windows-latest' }} run: just env - name: Print Tool versions (windows) if: ${{ matrix.os == 'windows-latest' }} # Only print rust version until the day more info is needed run: rustc --version - uses: taiki-e/install-action@nextest - name: Default test run: cargo nextest run --failure-output=immediate-final # Build all feature combinations - uses: taiki-e/install-action@cargo-hack - name: Build run: cargo hack build --feature-powerset --verbose # Test all feature combinations - name: Run Native Tests run: cargo hack nextest run --feature-powerset --failure-output=immediate-final # Run very involved tests targetting a docker container # includes e.g. # * Discovering and resolving an mDNS service broadcasting from within the container # * SSH authenticating into the container, spinning up qft through ssh, # querying for a free TCP port and finally completing a transfer via TCP. - name: Run Container Tests if: ${{ matrix.os == 'ubuntu-latest' }} run: | mkdir -p ~/.ssh ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N "" just mkdir-container-tmp just d-setup-for-transfer-tests cargo nextest run --run-ignored all container_tests --no-capture --cargo-verbose - name: Inspect Test container on failure if: ${{ matrix.os == 'ubuntu-latest' && failure() }} run: docker inspect alpine-qft-ssh - name: Test install.sh run: | bash www/install.sh --to /tmp --tag 0.2.0 /tmp/qft --version Docs: runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - name: Install `mdbook` & `mdbook-linkcheck` run: cargo install mdbook mdbook-linkcheck - name: Build book - Generate chapters working-directory: crates/generate-book run: cargo run - name: Build book - build site run: mdbook build book - name: Deploy Pages uses: peaceiris/actions-gh-pages@v4 if: github.ref == 'refs/heads/master' with: github_token: ${{secrets.GITHUB_TOKEN}} publish_branch: gh-pages publish_dir: www