Skip to content

Commit d6b20f1

Browse files
committed
ci: merge test-nydus job in test one
Signed-off-by: CrazyMax <[email protected]>
1 parent 82949ae commit d6b20f1

File tree

1 file changed

+22
-52
lines changed

1 file changed

+22
-52
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,27 @@ jobs:
9090
typ:
9191
- integration
9292
- dockerfile
93+
tags:
94+
- ''
9395
exclude:
9496
- pkg: ./client ./cmd/buildctl ./worker/containerd ./solver ./frontend
9597
typ: dockerfile
9698
include:
9799
- pkg: ./...
98100
skip-integration-tests: 1
99101
typ: integration gateway
102+
- pkg: ./client
103+
worker: containerd
104+
tags: nydus
105+
typ: integration
106+
- pkg: ./client
107+
worker: oci
108+
tags: nydus
109+
typ: integration
110+
- pkg: ./...
111+
tags: nydus
112+
skip-integration-tests: 1
113+
typ: integration
100114
steps:
101115
-
102116
name: Checkout
@@ -115,75 +129,31 @@ jobs:
115129
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
116130
buildkitd-flags: --debug
117131
-
118-
name: Test pkg=${{ matrix.pkg }} ; typ=${{ matrix.typ }} ; skipit=${{ matrix.skip-integration-tests }} ; worker=${{ matrix.worker }}
132+
name: Test
133+
continue-on-error: ${{ matrix.tags == 'nydus' }}
119134
run: |
135+
if [ -n "${{ matrix.tags }}" ]; then
136+
TESTFLAGS="${TESTFLAGS} --tags=${{ matrix.tags }}"
137+
export BUILDKITD_TAGS="${{ matrix.tags }}"
138+
fi
120139
if [ -n "${{ matrix.worker }}" ]; then
121140
export TESTFLAGS="${TESTFLAGS} --run=//worker=${{ matrix.worker }}$"
122141
fi
123142
./hack/test ${{ matrix.typ }}
124-
mv ./coverage/coverage.txt ./coverage/coverage-${{ github.job }}-$(echo "${{ matrix.pkg }}-${{ matrix.skip-integration-tests }}-${{ matrix.typ }}-${{ matrix.worker }}" | tr -dc '[:alnum:]-\n\r' | tr '[:upper:]' '[:lower:]').txt
143+
mv ./coverage/coverage.txt ./coverage/coverage-${{ github.job }}-$(echo "${{ matrix.pkg }}-${{ matrix.skip-integration-tests }}-${{ matrix.typ }}-${{ matrix.worker }}-${{ matrix.tags }}" | tr -dc '[:alnum:]-\n\r' | tr '[:upper:]' '[:lower:]').txt
125144
env:
126145
TEST_COVERAGE: 1
127146
TESTPKGS: ${{ matrix.pkg }}
128147
SKIP_INTEGRATION_TESTS: ${{ matrix.skip-integration-tests }}
129148
CACHE_FROM: type=gha,scope=${{ env.CACHE_GHA_SCOPE_IT }} type=gha,scope=${{ env.CACHE_GHA_SCOPE_BINARIES }}
130149
-
131150
name: Upload coverage file
151+
continue-on-error: ${{ matrix.tags == 'nydus' }}
132152
uses: actions/upload-artifact@v3
133153
with:
134154
name: coverage
135155
path: ./coverage
136156

137-
test-nydus:
138-
runs-on: ubuntu-20.04
139-
needs: [base]
140-
strategy:
141-
fail-fast: false
142-
matrix:
143-
pkg:
144-
- ./client
145-
worker:
146-
- containerd
147-
- oci
148-
typ:
149-
- integration
150-
exclude:
151-
- pkg: ./client ./cmd/buildctl ./worker/containerd ./solver ./frontend
152-
typ: dockerfile
153-
include:
154-
- pkg: ./...
155-
skip-integration-tests: 1
156-
typ: integration
157-
steps:
158-
-
159-
name: Checkout
160-
uses: actions/checkout@v3
161-
-
162-
name: Expose GitHub Runtime
163-
uses: crazy-max/ghaction-github-runtime@v2
164-
-
165-
name: Set up QEMU
166-
uses: docker/setup-qemu-action@v2
167-
-
168-
name: Set up Docker Buildx
169-
uses: docker/setup-buildx-action@v2
170-
with:
171-
version: ${{ env.BUILDX_VERSION }}
172-
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
173-
buildkitd-flags: --debug
174-
-
175-
name: Test pkg=${{ matrix.pkg }} ; typ=${{ matrix.typ }} ; skipit=${{ matrix.skip-integration-tests }} ; worker=${{ matrix.worker }}
176-
run: |
177-
if [ -n "${{ matrix.worker }}" ]; then
178-
export TESTFLAGS="${TESTFLAGS} --tags=nydus --run=//worker=${{ matrix.worker }}$"
179-
fi
180-
./hack/test ${{ matrix.typ }}
181-
env:
182-
BUILDKITD_TAGS: nydus
183-
TESTPKGS: ${{ matrix.pkg }}
184-
SKIP_INTEGRATION_TESTS: ${{ matrix.skip-integration-tests }}
185-
CACHE_FROM: type=gha,scope=${{ env.CACHE_GHA_SCOPE_IT }} type=gha,scope=${{ env.CACHE_GHA_SCOPE_BINARIES }}
186-
187157
test-os:
188158
runs-on: ${{ matrix.os }}
189159
strategy:

0 commit comments

Comments
 (0)