Skip to content

Commit

Permalink
chore(ci): check if devpod path exists on runner
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalbreuninger committed Jul 17, 2024
1 parent 103f57b commit 1aff83e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 31 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ jobs:
- name: Container cleanup
if: ${{ always() }}
run: |
Remove-Item -Recurse C:\Users\loft-user\.devpod\
if (Test-Path C:\Users\loft-user\.devpod\) {
Remove-Item -Recurse C:\Users\loft-user\.devpod\
}
sh -c "docker ps -q -a | xargs docker rm -f || :"
sh -c "docker images --format '{{.Repository}}:{{.Tag}},{{.ID}}' | grep -E 'devpod|none|temp|^test' | cut -d',' -f2 | xargs docker rmi -f || :"
sh -c "docker images --format '{{.Tag}}|{{.Digest}}' | grep none | cut -d'|' -f1 | xargs docker rmi -f || :"
62 changes: 32 additions & 30 deletions .github/workflows/e2e-win-full-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,35 @@ jobs:
- "up-docker-wsl"

steps:
- name: Git set line ending
run: |
git config --global core.autocrlf false
- name: Checkout repo
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21.8

- name: Build binary and copy to the E2E directory
run: |
mkdir e2e\bin
go build -ldflags "-s -w" -o e2e\bin\devpod-windows-amd64.exe
$Env:GOOS = "linux"; $Env:GOARCH = "amd64"; go build -ldflags "-s -w" -o e2e\bin\devpod-linux-amd64
- name: E2E test
working-directory: .\e2e
run: |
go run github.com/onsi/ginkgo/v2/ginkgo -r --timeout=3600s --label-filter=${{ matrix.label }}
- name: Container cleanup
if: ${{ always() }}
run: |
Remove-Item -Recurse C:\Users\loft-user\.devpod\
sh -c "docker ps -q -a | xargs docker rm -f || :"
sh -c "docker images --format '{{.Repository}}:{{.Tag}},{{.ID}}' | grep -E 'devpod|none|temp|^test' | cut -d',' -f2 | xargs docker rmi -f || :"
sh -c "docker images --format '{{.ID}}|{{.Digest}}' | grep none | cut -d'|' -f1 | xargs docker rmi -f || :"
- name: Git set line ending
run: |
git config --global core.autocrlf false
- name: Checkout repo
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.21.8

- name: Build binary and copy to the E2E directory
run: |
mkdir e2e\bin
go build -ldflags "-s -w" -o e2e\bin\devpod-windows-amd64.exe
$Env:GOOS = "linux"; $Env:GOARCH = "amd64"; go build -ldflags "-s -w" -o e2e\bin\devpod-linux-amd64
- name: E2E test
working-directory: .\e2e
run: |
go run github.com/onsi/ginkgo/v2/ginkgo -r --timeout=3600s --label-filter=${{ matrix.label }}
- name: Container cleanup
if: ${{ always() }}
run: |
if (Test-Path C:\Users\loft-user\.devpod\) {
Remove-Item -Recurse C:\Users\loft-user\.devpod\
}
sh -c "docker ps -q -a | xargs docker rm -f || :"
sh -c "docker images --format '{{.Repository}}:{{.Tag}},{{.ID}}' | grep -E 'devpod|none|temp|^test' | cut -d',' -f2 | xargs docker rmi -f || :"
sh -c "docker images --format '{{.ID}}|{{.Digest}}' | grep none | cut -d'|' -f1 | xargs docker rmi -f || :"

0 comments on commit 1aff83e

Please sign in to comment.