Skip to content

Merge pull request #55 from Manavarya09/feat/chain-fallback #58

Merge pull request #55 from Manavarya09/feat/chain-fallback

Merge pull request #55 from Manavarya09/feat/chain-fallback #58

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: "core -> target"
- name: Check
run: cd core && cargo check
- name: Test
run: cd core && cargo test
- name: Build release
run: cd core && cargo build --release
- name: Binary size (Unix)
if: runner.os != 'Windows'
run: ls -lh core/target/release/relay
- name: Binary size (Windows)
if: runner.os == 'Windows'
run: dir core\target\release\relay.exe
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: "core -> target"
- name: Clippy
run: cd core && cargo clippy -- -W clippy::all -A clippy::print_literal -A clippy::new_without_default -A clippy::should_implement_trait -A clippy::collapsible_if -A clippy::option_map_or_none
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [test, clippy]
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact: relay-linux-x86_64
- os: macos-latest
target: aarch64-apple-darwin
artifact: relay-macos-arm64
- os: macos-latest
target: x86_64-apple-darwin
artifact: relay-macos-x86_64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact: relay-windows-x86_64.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
workspaces: "core -> target"
- name: Build
run: cd core && cargo build --release --target ${{ matrix.target }}
- name: Rename binary (Unix)
if: runner.os != 'Windows'
run: cp core/target/${{ matrix.target }}/release/relay ${{ matrix.artifact }}
- name: Rename binary (Windows)
if: runner.os == 'Windows'
run: copy core\target\${{ matrix.target }}\release\relay.exe ${{ matrix.artifact }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
publish-release:
if: startsWith(github.ref, 'refs/tags/v')
needs: release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
relay-linux-x86_64
relay-macos-arm64
relay-macos-x86_64
relay-windows-x86_64.exe