name: Build and test
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ${{ matrix.job.os }}
strategy:
matrix:
job:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
protoc: linux-x86_64
steps:
- uses: actions/checkout@v4
- run: |
cd $(mktemp -d)
wget https://github.com/protocolbuffers/protobuf/releases/download/v26.0/protoc-26.0-${{ matrix.job.protoc }}.zip
unzip protoc-26.0-${{ matrix.job.protoc }}.zip
sudo mv bin/protoc /usr/local/bin/
- name: Run tests
run: cargo test --verbose
build:
runs-on: ${{ matrix.job.os }}
strategy:
matrix:
job:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
protoc: linux-x86_64
gcc: gcc-x86-64-linux-gnu
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
protoc: linux-x86_64
gcc: gcc-aarch64-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
protoc: osx-x86_64
- os: macos-latest
target: aarch64-apple-darwin
protoc: osx-x86_64
steps:
- uses: actions/checkout@v4
- run: |
cd $(mktemp -d)
wget https://github.com/protocolbuffers/protobuf/releases/download/v26.0/protoc-26.0-${{ matrix.job.protoc }}.zip
unzip protoc-26.0-${{ matrix.job.protoc }}.zip
sudo mv bin/protoc /usr/local/bin/
- run: rustup target add ${{ matrix.job.target }}
- run: sudo apt-get install -y ${{ matrix.job.gcc }}
if: ${{ matrix.job.os == 'ubuntu-latest' }}
- name: Build
run: |
cargo build --release --target ${{ matrix.job.target }}
mv target/${{ matrix.job.target }}/release/stablessh stablessh-${{ matrix.job.target }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: stablessh-${{ matrix.job.target }}
path: stablessh-${{ matrix.job.target }}