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.
Add E2E tests and workflow (dragonflyoss#402)
Signed-off-by: Gaius <gaius.qi@gmail.com> Co-authored-by: Jim Ma <majinjing3@gmail.com>
- Loading branch information
Showing
11 changed files
with
411 additions
and
25 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,91 @@ | ||
name: 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 | ||
|
||
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 | ||
|
||
- 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 | ||
- name: Set up containerd | ||
uses: crazy-max/ghaction-setup-containerd@v1 | ||
with: | ||
containerd-version: ${{ env.CONTAINERD_VERSION }} | ||
config: ./test/testdata/containerd/config.toml | ||
|
||
- name: Set up crictl | ||
run: | | ||
wget https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.21.0/crictl-v1.21.0-linux-amd64.tar.gz | ||
sudo tar zxvf crictl-v1.21.0-linux-amd64.tar.gz -C /usr/local/bin | ||
sudo mv ./test/testdata/crictl/config.yaml /etc/crictl.yaml | ||
rm -f crictl-v1.21.0-linux-amd64.tar.gz | ||
- name: Setup Kind | ||
uses: engineerd/setup-kind@v0.5.0 | ||
with: | ||
version: ${{ env.KIND_VERSION }} | ||
config: ./test/testdata/kind/config.yaml | ||
|
||
- name: Build docker image | ||
run: | | ||
make docker-build | ||
- name: Load docker image | ||
run: | | ||
make kind-load | ||
- name: Helm install | ||
run: | | ||
helm lint ./deploy/charts/dragonfly | ||
helm install --create-namespace --namespace dragonfly-system dragonfly ./deploy/charts/dragonfly | ||
- name: Wait for running | ||
run: kubectl -n dragonfly-system wait --for=condition=ready --all --timeout=10m pod | ||
|
||
- name: Run E2E tests | ||
run: make e2e-test-coverage | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.txt | ||
flags: e2etests |
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
Oops, something went wrong.