Nightly E2E Fleet #174
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
# Workflow tests more k8s versions than the e2e-ci workflow for PR does | |
name: Nightly E2E Fleet | |
on: | |
schedule: | |
# Run everyday day at 7:00 AM | |
- cron: '0 7 * * *' | |
workflow_dispatch: | |
env: | |
GOARCH: amd64 | |
CGO_ENABLED: 0 | |
SETUP_GO_VERSION: '1.19.*' | |
SETUP_K3D_VERSION: 'v5.4.7' | |
jobs: | |
e2e-fleet-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
k3s_version: | |
# k3d version list k3s | sed 's/+/-/' | sort -h | |
# https://hub.docker.com/r/rancher/k3s/tags | |
- v1.27.1-k3s1 | |
- v1.26.4-k3s1 | |
- v1.25.4-k3s1 | |
- v1.24.1-k3s1 | |
- v1.22.10-k3s1 | |
- v1.20.15-k3s1 | |
steps: | |
- | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.SETUP_GO_VERSION }} | |
- | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- | |
name: Install Ginkgo CLI | |
run: go install github.com/onsi/ginkgo/v2/[email protected] | |
- | |
name: Build Fleet Binaries | |
run: | | |
go build -o bin/fleetcontroller-linux-$GOARCH ./cmd/fleetcontroller | |
go build -o "bin/fleet-linux-$GOARCH" | |
go build -o "bin/fleetagent-linux-$GOARCH" ./cmd/fleetagent | |
- | |
name: Build Docker Images | |
run: | | |
docker build -f package/Dockerfile -t rancher/fleet:dev --build-arg="ARCH=$GOARCH" . | |
docker build -f package/Dockerfile.agent -t rancher/fleet-agent:dev --build-arg="ARCH=$GOARCH" . | |
- | |
name: Provision k3d Cluster | |
uses: AbsaOSS/k3d-action@v2 | |
# k3d will automatically create a network named k3d-test-cluster-1 with the range 172.18.0.0/16 | |
with: | |
k3d-version: ${{ env.SETUP_K3D_VERSION }} | |
cluster-name: "k3s-default" | |
args: >- | |
--agents 3 | |
--network "nw01" | |
--image docker.io/rancher/k3s:${{matrix.k3s_version}} | |
- | |
name: Import Images Into k3d | |
run: | | |
k3d image import rancher/fleet:dev rancher/fleet-agent:dev | |
- | |
name: Deploy Fleet | |
run: | | |
./.github/scripts/deploy-fleet.sh | |
- | |
name: E2E Tests | |
env: | |
FLEET_E2E_NS: fleet-local | |
run: | | |
ginkgo e2e/single-cluster e2e/keep-resources | |
- | |
name: Acceptance Tests for Examples | |
env: | |
FLEET_E2E_NS: fleet-local | |
run: | | |
ginkgo e2e/acceptance/single-cluster-examples | |
- | |
name: Fleet Tests Requiring Github Secrets | |
env: | |
FLEET_E2E_NS: fleet-local | |
GIT_REPO_URL: "[email protected]:fleetrepoci/test.git" | |
GIT_REPO_HOST: "github.com" | |
GIT_REPO_USER: "git" | |
GIT_REPO_BRANCH: ${{ matrix.k3s_version }} | |
CI_OCI_USERNAME: ${{ secrets.CI_OCI_USERNAME }} | |
CI_OCI_PASSWORD: ${{ secrets.CI_OCI_PASSWORD }} | |
run: | | |
export GIT_SSH_KEY="$GITHUB_WORKSPACE/id_ecdsa" | |
export GIT_SSH_PUBKEY="$GITHUB_WORKSPACE/id_ecdsa.pub" | |
echo "${{ secrets.CI_SSH_KEY }}" > "$GIT_SSH_KEY" | |
echo "${{ secrets.CI_SSH_PUBKEY }}" > "$GIT_SSH_PUBKEY" | |
ginkgo e2e/require-secrets | |
- | |
name: Dump Failed Environment | |
if: failure() | |
run: | | |
mkdir -p tmp | |
./.github/scripts/dump-failed-k3ds.sh | |
- | |
name: Upload Logs | |
uses: actions/upload-artifact@v3 | |
if: failure() | |
with: | |
name: gha-nightly-e2e-logs-${{ github.sha }}-${{ matrix.k3s_version }}-${{ github.run_id }} | |
path: | | |
tmp/*.json | |
tmp/*.log | |
retention-days: 2 |