diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 10ff7a3542..41a561a5d2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -9,6 +9,7 @@ jobs: build: runs-on: ubuntu-latest steps: + # Checkout should always be before setup-go to ensure caching is working - uses: actions/checkout@v4 with: fetch-depth: 2 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 246a7d9f2d..75ffa0cdc0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -7,7 +7,11 @@ jobs: name: Ensure docs are generated runs-on: ubuntu-latest steps: + # Checkout should always be before setup-go to ensure caching is working - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: '1.22' - name: Generate code run: go run ./cmd/scw-doc-gen env: diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index ef73dc3ec1..43f7415ae4 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -12,22 +12,23 @@ jobs: platform: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go-version }} - - 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 - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 1 - - 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 + - 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: @@ -36,14 +37,15 @@ jobs: platform: [ubuntu-latest] runs-on: ${{ matrix.platform }} steps: - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go-version }} + # 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 diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index f605a7a520..2e5c7814cf 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -12,6 +12,11 @@ jobs: 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: @@ -20,10 +25,6 @@ jobs: uses: pnpm/action-setup@v4 with: version: 6.0.2 - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 1 - name: Build run: ./scripts/build-wasm.sh - name: Run npm package tests