gcs-rsync 0.4.8

rsync support for gcs with higher perf than gsutil rsync
Documentation
name: build

on:
  push:
    branches: [ main ]
  pull_request:
    branches: 
      - '*'

env:
  CARGO_TERM_COLOR: always

  EXAMPLE_BUCKET: gcs-rsync-dev
  EXAMPLE_PREFIX: example-ci

  TEST_BUCKET: gcs-rsync-dev
  TEST_PREFIX: integration-test-ci
  TEST_SERVICE_ACCOUNT: service_account.json
  GOOGLE_APPLICATION_CREDENTIALS: default_token.json

jobs:
  lint: 
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: fmt
        run: cargo fmt --all -- --check
      - name: clippy
        run: cargo clippy --all-targets --all-features -- -D warnings

  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: build
        run: cargo build --verbose
      - name: unit tests
        run: cargo test --lib --verbose

  check:
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
    name: code coverage (unit + integration tests)
    env:
      GOOGLE_APPLICATION_CREDENTIALS_TOKEN: ${{ secrets.TEST_GOOGLE_APPLICATION_CREDENTIALS_TOKEN }}
      TEST_SERVICE_ACCOUNT_TOKEN: ${{ secrets.TEST_SERVICE_ACCOUNT_TOKEN }} 
    runs-on: ${{ matrix.os }}
    defaults:
      run:
        shell: bash
    steps:
      - uses: actions/checkout@v3

      - name: Setup test default token
        run: 'echo "$GOOGLE_APPLICATION_CREDENTIALS_TOKEN" > default_token.json'

      - name: Setup test service_account token
        run: 'echo "$TEST_SERVICE_ACCOUNT_TOKEN" > service_account.json'

      - uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true
          components: llvm-tools-preview

      - name: Integration tests (Windows only/no coverage)
        if: runner.os == 'Windows'
        run: cargo test

      - name: Download grcov
        if: runner.os == 'Linux'
        run: |
          mkdir -p "${HOME}/.local/bin"
          curl -sL https://github.com/mozilla/grcov/releases/download/v0.8.20/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - -C "${HOME}/.local/bin"
          echo "$HOME/.local/bin" >> $GITHUB_PATH

      - name: Coverage 
        if: runner.os == 'Linux'
        run: cargo run --manifest-path ./xtask/Cargo.toml -- coverage

      - name: Upload to codecov.io
        if: runner.os == 'Linux'
        uses: codecov/codecov-action@v5
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: coverage/*.lcov