Skip to content

Commit

Permalink
chore: Shard testscript tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KapJI committed Nov 9, 2024
1 parent 9782de3 commit d94d8e6
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,14 @@ jobs:
name: chezmoi-windows-amd64
path: dist/chezmoi-nocgo_windows_amd64_v1/chezmoi.exe
test-ubuntu:
name: test-ubuntu-umask${{ matrix.umask }}-${{ matrix.test-index }}
strategy:
fail-fast: false
matrix:
umask:
- "022"
- "002"
test-index: [0, 1]
needs: changes
runs-on: ubuntu-20.04 # use older Ubuntu for older glibc
permissions:
Expand All @@ -288,9 +290,9 @@ jobs:
path: |
/home/runner/go/pkg/mod
/home/runner/.cache/go-build
key: setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
key: tests-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
setup-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-
tests-go-${{ runner.os }}-x64-ubuntu22-go-${{ env.GO_VERSION }}-
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
cache: false
Expand Down Expand Up @@ -318,8 +320,14 @@ jobs:
if: github.event_name == 'push' || needs.changes.outputs.code == 'true'
env:
CHEZMOI_GITHUB_TOKEN: ${{ secrets.CHEZMOI_GITHUB_TOKEN }}
run: |
go test -ldflags="-X github.com/twpayne/chezmoi/v2/internal/chezmoitest.umaskStr=0o${{ matrix.umask }}" -race -timeout=1h ./...
TEST_FLAGS: '-ldflags="-X github.com/twpayne/chezmoi/v2/internal/chezmoitest.umaskStr=0o${{ matrix.umask }}" -race -timeout=1h'
run: |
if [ "${{ matrix.test-index }}" = "0" ]; then
go test ./... -short ${{ env.TEST_FLAGS }}
go test ./internal/cmd -run=TestScript -filter='^[0-9a-hA-h]' ${{ env.TEST_FLAGS }}
else
go test ./internal/cmd -run=TestScript -filter='^[i-zI-Z]' ${{ env.TEST_FLAGS }}
fi
test-website:
runs-on: ubuntu-22.04
permissions:
Expand Down

0 comments on commit d94d8e6

Please sign in to comment.