Skip to content
edgesync Artifact [75aaa0887c]
Login

Artifact [75aaa0887c]

Artifact 75aaa0887cd73c227bda8367b6ccf15819cd010fb63c21ba8b05f5c3d5130d5e:


name: CI

on:
  push:
    branches: [main]
    paths-ignore:
      - '**.md'
      - 'docs/**'
      - 'wrangler.jsonc'
      - 'LICENSE'
  pull_request:
    branches: [main]
    paths-ignore:
      - '**.md'
      - 'docs/**'
      - 'wrangler.jsonc'
      - 'LICENSE'

env:
  GOWORK: "off"

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6

      - uses: actions/setup-go@v6
        with:
          go-version-file: go.mod

      - name: Vet
        run: |
          go vet ./...
          cd leaf && go vet ./...
          cd ../bridge && go vet ./...

      - name: Unit tests (leaf + bridge in parallel)
        run: |
          cd leaf && go test ./... -short -count=1 &
          PID_LEAF=$!
          cd bridge && go test ./... -short -count=1 &
          PID_BRIDGE=$!
          wait $PID_LEAF
          wait $PID_BRIDGE

      - name: CLI build
        run: go build -buildvcs=false ./cmd/edgesync/

      - name: CLI tests
        run: go test -buildvcs=false ./cmd/edgesync/ -count=1 -timeout=60s

  install-script:
    # install.sh runs against the latest published release, so a change to
    # it, or to goreleaser's archive names, fails here.
    name: install script (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
    steps:
      - uses: actions/checkout@v6
      - name: install.sh
        env:
          EDGESYNC_INSTALL_DIR: ${{ runner.temp }}/edgesync-bin
        run: |
          sh install.sh
          "$EDGESYNC_INSTALL_DIR/edgesync" --version
          "$EDGESYNC_INSTALL_DIR/leaf" -h 2>&1 | grep -q 'Usage of'