feat: use rsync instead of sftp #621
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Run tests" | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'release/**' | |
| pull_request: | |
| branches: | |
| - '**' | |
| types: | |
| - opened | |
| - edited | |
| - synchronize | |
| workflow_dispatch: | |
| jobs: | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }} | |
| TS_NODE_AUTH_KEY: ${{ secrets.TS_NODE_AUTH_KEY }} | |
| TS_SERVER_OAUTH_SECRET: ${{ secrets.TS_SERVER_OAUTH_SECRET }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Connect to Tailscale | |
| uses: tailscale/github-action@v4 | |
| with: | |
| authkey: ${{ secrets.TS_CI_AUTH_KEY }} | |
| - name: Install openrsync | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential libbsd-dev pkg-config | |
| # Build openrsync from source | |
| cd /tmp | |
| wget https://github.com/kristapsdz/openrsync/archive/refs/tags/v9.0.1.tar.gz | |
| tar -xzf v9.0.1.tar.gz | |
| cd openrsync-9.0.1 | |
| ./configure | |
| make | |
| sudo make install | |
| # Verify installation and make openrsync the default rsync | |
| which openrsync | |
| openrsync --version || true | |
| sudo ln -sf $(which openrsync) /usr/local/bin/rsync | |
| # Verify rsync now points to openrsync | |
| rsync --version | |
| - name: Setup Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24' | |
| - uses: depot/setup-action@v1 | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| role-to-assume: arn:aws:iam::494494944992:role/GithubImagePusher | |
| role-session-name: ${{ github.job }}-${{ github.run_id }} | |
| aws-region: us-east-2 | |
| - name: Login to Amazon ECR | |
| id: login-ecr | |
| uses: aws-actions/amazon-ecr-login@v2 | |
| - name: Install Latest Docker | |
| run: | | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
| sudo apt-get update | |
| sudo apt-get install docker-ce | |
| - name: Run unit tests | |
| run: | | |
| make tidy | |
| make unit-test | |
| petri-unit-test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }} | |
| TS_NODE_AUTH_KEY: ${{ secrets.TS_NODE_AUTH_KEY }} | |
| TS_SERVER_OAUTH_SECRET: ${{ secrets.TS_SERVER_OAUTH_SECRET }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24' | |
| - uses: dorny/paths-filter@v3 | |
| id: petri-filter | |
| with: | |
| filters: | | |
| petri: | |
| - 'petri/**' | |
| - name: Install Latest Docker | |
| if: steps.petri-filter.outputs.petri == 'true' | |
| run: | | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
| sudo apt-get update | |
| sudo apt-get install docker-ce | |
| - name: Run petri unit tests | |
| if: steps.petri-filter.outputs.petri == 'true' | |
| run: | | |
| make tidy | |
| make petri-unit-test | |
| petri-docker-e2e: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24' | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| petri: | |
| - 'petri/**' | |
| - name: Install Latest Docker | |
| if: steps.filter.outputs.petri == 'true' | |
| run: | | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
| sudo apt-get update | |
| sudo apt-get install docker-ce | |
| - name: Run petri Docker E2E tests | |
| if: steps.filter.outputs.petri == 'true' | |
| run: | | |
| make tidy | |
| make petri-docker-e2e | |
| petri-digitalocean-e2e: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }} | |
| TS_NODE_AUTH_KEY: ${{ secrets.TS_NODE_AUTH_KEY }} | |
| TS_SERVER_OAUTH_SECRET: ${{ secrets.TS_SERVER_OAUTH_SECRET }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Connect to Tailscale | |
| uses: tailscale/github-action@v4 | |
| with: | |
| authkey: ${{ secrets.TS_CI_AUTH_KEY }} | |
| - name: Install openrsync | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential libbsd-dev pkg-config | |
| # Build openrsync from source | |
| cd /tmp | |
| wget https://github.com/kristapsdz/openrsync/archive/refs/tags/v9.0.1.tar.gz | |
| tar -xzf v9.0.1.tar.gz | |
| cd openrsync-9.0.1 | |
| ./configure | |
| make | |
| sudo make install | |
| # Verify installation and make openrsync the default rsync | |
| which openrsync | |
| openrsync --version || true | |
| sudo ln -sf $(which openrsync) /usr/local/bin/rsync | |
| # Verify rsync now points to openrsync | |
| rsync --version | |
| - name: Setup Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.24' | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| digitalocean: | |
| - 'petri/cosmos/**' | |
| - 'petri/core/provider/digitalocean/**' | |
| - 'petri/core/provider/clients/**' | |
| - name: Run petri DigitalOcean E2E tests | |
| if: steps.filter.outputs.digitalocean == 'true' | |
| run: | | |
| make tidy | |
| make petri-digitalocean-e2e |