Tests #8094
Workflow file for this run
This file contains 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: Tests | |
on: | |
pull_request: | |
merge_group: | |
jobs: | |
os-tests: | |
strategy: | |
matrix: | |
go-version: [1.22.x] | |
platform: [ubuntu-latest, macos-latest, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Set git to use LF to avoid problem with goldens on windows | |
run: | | |
git config --global core.autocrlf false | |
git config --global core.eol lf | |
# Checkout should always be before setup-go to ensure caching is working | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Run unit tests | |
run: go test ./... | |
- name: Execute main binary # Test the runtime for potential panics. | |
run: go run cmd/scw/main.go -h | |
build-tests: | |
strategy: | |
matrix: | |
go-version: [1.22.x] | |
platform: [ubuntu-latest] | |
runs-on: ${{ matrix.platform }} | |
steps: | |
# Checkout should always be before setup-go to ensure caching is working | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Build binaries | |
run: ./scripts/build.sh | |
- name: Print binaries size | |
run: ls -lh ./bin | |
- name: Check binary size | |
run: ./scripts/check-size.sh ./bin/*linux-x86_64 | |
docker-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Build image in Docker | |
run: docker build -t scaleway/cli . | |
- name: Test help command in docker | |
run: docker run -i scaleway/cli version |