From f4f12746c199a39d7044ad6025a7b7ead4550848 Mon Sep 17 00:00:00 2001 From: ssrlive <30760636+ssrlive@users.noreply.github.com> Date: Wed, 22 Jan 2025 23:56:07 +0800 Subject: [PATCH] freebsd testing --- .github/workflows/freebsd.yml | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/freebsd.yml diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml new file mode 100644 index 0000000..c47b038 --- /dev/null +++ b/.github/workflows/freebsd.yml @@ -0,0 +1,58 @@ +name: TestFreeBSD + +on: + [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: ["stable"] # ["nightly", "beta", "stable"] # + steps: + - uses: actions/checkout@v4 + - name: Test in FreeBSD + id: test + uses: vmactions/freebsd-vm@v1 + with: + usesh: true + sync: rsync + copyback: true + prepare: | + pkg install -y curl pkgconf glib + curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf > install.sh + chmod +x install.sh + ./install.sh -y --default-toolchain ${{ matrix.toolchain }} + run: | + . "$HOME/.cargo/env" + set -ex + + # Add feature "nightly" if toolchain is nightly + if [ "${{ matrix.toolchain }}" = "nightly" ]; then + ARGS="$ARGS --features nightly" + fi + + RUST_BACKTRACE=1 cargo +${{ matrix.toolchain }} fmt --all -- --check + RUST_BACKTRACE=1 cargo +${{ matrix.toolchain }} clippy --all-features --release -- -D warnings + RUST_BACKTRACE=1 cargo +${{ matrix.toolchain }} build --all-features --release + + - name: archive + run: | + mkdir -p pubdir + ls ./target/release/ + zip -j pubdir/overtls-x86_64-unknown-freebsd.zip ./target/release/overtls-bin ./config.json + + - name: Publish + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: pubdir/* + name: Automated build of ${{ github.sha }} + tag_name: r${{ github.sha }} + draft: false + prerelease: true