forked from dragonflyoss/dragonfly
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add compatibility test workflow (dragonflyoss#594)
* chore: add compatibility test workflow Signed-off-by: Gaius <[email protected]>
- Loading branch information
Showing
6 changed files
with
179 additions
and
64 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: Compatibility E2E Test | ||
|
||
on: | ||
push: | ||
branches: [main, release-*] | ||
pull_request: | ||
branches: [main, release-*] | ||
|
||
env: | ||
GO_VERSION: 1.15 | ||
KIND_VERSION: v0.11.1 | ||
CONTAINERD_VERSION: v1.5.2 | ||
GOPROXY: https://goproxy.io,direct | ||
KIND_CONFIG_PATH: test/testdata/kind/config.yaml | ||
DRAGONFLY_E2E_TEST_MODE: compatibility | ||
DRAGONFLY_DFDAEMON_IMAGE: dragonflyoss/dfdaemon:v0.4.0 | ||
DRAGONFLY_CHARTS_PATH: deploy/helm-charts/charts/dragonfly | ||
DRAGONFLY_CHARTS_CONFIG_PATH: test/testdata/charts/compatibility-config.yaml | ||
DRAGONFLY_FILE_SERVER_PATH: test/testdata/k8s/file-server.yaml | ||
|
||
jobs: | ||
skip_check: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- name: Skip Check | ||
id: skip_check | ||
uses: fkirc/skip-duplicate-actions@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
paths_ignore: '["**.md", "**.png", "**.jpg", "**.svg"]' | ||
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' | ||
|
||
e2e_tests: | ||
runs-on: ubuntu-latest | ||
needs: skip_check | ||
if: needs.skip_check.outputs.noop != 'true' | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
|
||
- name: Get dependencies | ||
run: | | ||
go mod vendor | ||
go get github.com/onsi/ginkgo/ginkgo | ||
mkdir -p /tmp/artifact | ||
- name: Setup Kind | ||
uses: engineerd/[email protected] | ||
with: | ||
version: ${{ env.KIND_VERSION }} | ||
config: ${{ env.KIND_CONFIG_PATH }} | ||
|
||
- name: Build images | ||
run: | | ||
make docker-build-manager | ||
make docker-build-cdn | ||
make docker-build-scheduler | ||
docker pull ${{ env.DRAGONFLY_DFDAEMON_IMAGE }} | ||
- name: Prepare kind environment | ||
run: | | ||
make kind-load-manager | ||
make kind-load-cdn | ||
make kind-load-scheduler | ||
kind load docker-image ${{ env.DRAGONFLY_DFDAEMON_IMAGE }} | ||
- name: Setup dragonfly | ||
run: | | ||
helm install --wait --timeout 10m --dependency-update --create-namespace --namespace dragonfly-system -f ${{ env.DRAGONFLY_CHARTS_CONFIG_PATH }} dragonfly ${{ env.DRAGONFLY_CHARTS_PATH }} | ||
kubectl apply -f ${{ env.DRAGONFLY_FILE_SERVER_PATH }} | ||
kubectl wait po file-server-0 --namespace dragonfly-e2e --for=condition=ready --timeout=10m | ||
- name: Run compatibility E2E test | ||
run: make actions-e2e-test-coverage | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.txt | ||
flags: compatibility-e2etests | ||
|
||
- name: Upload Logs | ||
uses: actions/upload-artifact@v2 | ||
if: failure() | ||
with: | ||
name: dragonfly-logs | ||
path: /tmp/artifact/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,10 @@ env: | |
KIND_VERSION: v0.11.1 | ||
CONTAINERD_VERSION: v1.5.2 | ||
GOPROXY: https://goproxy.io,direct | ||
KIND_CONFIG_PATH: test/testdata/kind/config.yaml | ||
DRAGONFLY_CHARTS_PATH: deploy/helm-charts/charts/dragonfly | ||
DRAGONFLY_CHARTS_CONFIG_PATH: test/testdata/charts/config.yaml | ||
DRAGONFLY_FILE_SERVER_PATH: test/testdata/k8s/file-server.yaml | ||
|
||
jobs: | ||
skip_check: | ||
|
@@ -45,15 +49,28 @@ jobs: | |
- name: Get dependencies | ||
run: | | ||
go mod vendor | ||
go get github.com/onsi/ginkgo/ginkgo | ||
mkdir -p /tmp/artifact | ||
- name: Setup Kind | ||
uses: engineerd/[email protected] | ||
with: | ||
version: ${{ env.KIND_VERSION }} | ||
config: ./test/testdata/kind/config.yaml | ||
config: ${{ env.KIND_CONFIG_PATH }} | ||
|
||
- name: Run E2E tests | ||
- name: Build images | ||
run: make docker-build | ||
|
||
- name: Prepare kind environment | ||
run: make kind-load | ||
|
||
- name: Setup dragonfly | ||
run: | | ||
helm install --wait --timeout 10m --dependency-update --create-namespace --namespace dragonfly-system -f ${{ env.DRAGONFLY_CHARTS_CONFIG_PATH }} dragonfly ${{ env.DRAGONFLY_CHARTS_PATH }} | ||
kubectl apply -f ${{ env.DRAGONFLY_FILE_SERVER_PATH }} | ||
kubectl wait po file-server-0 --namespace dragonfly-e2e --for=condition=ready --timeout=10m | ||
- name: Run E2E test | ||
run: make actions-e2e-test-coverage | ||
|
||
- name: Upload coverage to Codecov | ||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
scheduler: | ||
image: d7yio/scheduler | ||
tag: latest | ||
|
||
cdn: | ||
image: d7yio/cdn | ||
tag: latest | ||
|
||
dfdaemon: | ||
image: dragonflyoss/dfdaemon | ||
tag: v0.4.0 | ||
config: | ||
proxy: | ||
defaultFilter: "Expires&Signature" | ||
security: | ||
insecure: true | ||
tcpListen: | ||
namespace: /run/dragonfly/net | ||
listen: 0.0.0.0 | ||
# if you want to change port, please update hostPort in $.Values.dfdaemon.hostPort | ||
# port in configmap is generated from $.Values.dfdaemon.hostPort | ||
# port: 65001 | ||
registryMirror: | ||
url: https://index.docker.io | ||
proxies: | ||
- regx: blobs/sha256.* | ||
- regx: file-server | ||
|
||
manager: | ||
image: d7yio/manager | ||
tag: latest |