feat: setup integration tests #204
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR Workflow | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - main | |
| pull_request: | |
| jobs: | |
| check: | |
| strategy: | |
| matrix: | |
| target: | |
| - os: linux | |
| arch: "amd64" | |
| rust-target: "x86_64-unknown-linux-gnu" | |
| - os: linux | |
| arch: "amd64-musl" | |
| rust-target: "x86_64-unknown-linux-musl" | |
| - os: linux | |
| arch: "arm64" | |
| rust-target: "aarch64-unknown-linux-gnu" | |
| - os: darwin | |
| arch: "amd64" | |
| rust-target: "x86_64-apple-darwin" | |
| - os: darwin | |
| arch: "arm64" | |
| rust-target: "aarch64-apple-darwin" | |
| - os: windows | |
| arch: "amd64" | |
| rust-target: "x86_64-pc-windows-msvc" | |
| - os: windows | |
| arch: "arm64" | |
| rust-target: "aarch64-pc-windows-msvc" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install toolchain | |
| run: rustup toolchain install stable --profile minimal --target ${{ matrix.target.rust-target }} --no-self-update | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo check --target ${{ matrix.target.rust-target }} | |
| clippy: | |
| needs: | |
| - check | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install toolchain | |
| run: rustup toolchain install stable --profile minimal --component clippy --no-self-update | |
| - uses: Swatinem/rust-cache@v2 | |
| - run: cargo clippy --all-targets --all-features -- -W clippy::pedantic -D warnings | |
| test: | |
| needs: | |
| - clippy | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install toolchain | |
| run: rustup toolchain install stable --profile minimal --no-self-update | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Start test SSH server | |
| run: docker compose up --build --wait | |
| - name: Run tests | |
| run: cargo test | |
| build: | |
| needs: | |
| - test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - os: linux | |
| arch: "amd64" | |
| rust-target: "x86_64-unknown-linux-gnu" | |
| runs-on: ubuntu-24.04 | |
| - os: linux | |
| arch: "amd64-musl" | |
| rust-target: "x86_64-unknown-linux-musl" | |
| runs-on: ubuntu-24.04 | |
| - os: linux | |
| arch: "arm64" | |
| rust-target: "aarch64-unknown-linux-gnu" | |
| runs-on: ubuntu-24.04-arm | |
| - os: darwin | |
| arch: "amd64" | |
| rust-target: "x86_64-apple-darwin" | |
| runs-on: macos-latest | |
| - os: darwin | |
| arch: "arm64" | |
| rust-target: "aarch64-apple-darwin" | |
| runs-on: macos-latest | |
| - os: windows | |
| arch: "amd64" | |
| rust-target: "x86_64-pc-windows-msvc" | |
| runs-on: windows-latest | |
| - os: windows | |
| arch: "arm64" | |
| rust-target: "aarch64-pc-windows-msvc" | |
| runs-on: windows-latest | |
| runs-on: ${{ matrix.target.runs-on }} | |
| name: Build and save artifact | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install toolchain | |
| run: rustup toolchain install stable --profile minimal --target ${{ matrix.target.rust-target }} --no-self-update | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Build | |
| run: cargo build --release --target ${{ matrix.target.rust-target }} | |
| - name: Set .exe extension for Windows | |
| id: set_extension | |
| run: echo "extension=.exe" >> $GITHUB_OUTPUT | |
| if: ${{ matrix.target.os == 'windows' }} | |
| - name: Set executable filename | |
| id: set_filename | |
| run: echo "filename=sshs-${{ matrix.target.os }}-${{ matrix.target.arch }}${{ steps.set_extension.outputs.extension }}" >> $GITHUB_OUTPUT | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| if-no-files-found: error | |
| name: ${{ steps.set_filename.outputs.filename }} | |
| path: target/${{ matrix.target.rust-target }}/release/sshs${{ steps.set_extension.outputs.extension }} | |
| compression-level: 0 | |
| # nix: | |
| # runs-on: ubuntu-24.04 | |
| # steps: | |
| # - uses: actions/checkout@v2 | |
| # - uses: cachix/install-nix-action@v17 | |
| # with: | |
| # nix_path: nixpkgs=channel:nixos-unstable | |
| # - run: nix build | |
| # - run: nix flake check |