[download] Refactor handleExistingFile #2265
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: integration tests | |
| on: [push] | |
| jobs: | |
| integrationtests: | |
| name: integration-s3 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: '1.25' | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.9' | |
| - name: Build go code | |
| run: | | |
| # Get the module name from go.mod automatically | |
| MOD_NAME=$(go list -m) | |
| # Build a version that is new enough for the success test | |
| go build -ldflags "-X ${MOD_NAME}/cmd.Version=v0.3.0" -o sda-cli | |
| # Build an outdated version for the failure test (the minimal required version is 0.2.0) | |
| go build -ldflags "-X ${MOD_NAME}/cmd.Version=v0.1.0" -o sda-cli-v0.1.0 | |
| - name: Setup environment | |
| run: bash -x .github/integration/setup/setup.sh | |
| - name: Run tests | |
| run: | | |
| ls -1 .github/integration/tests/*.sh 2>/dev/null | sort -t/ -k5 -n | while read -r runscript; do | |
| echo "Executing setup script $runscript"; | |
| bash -x "$runscript"; | |
| done |