Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions .github/workflows/all-e2e-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: all E2E tests

on:
workflow_dispatch:
pull_request:
branches: [ main ]
paths:
- ".github/workflows/all-e2e-test.yaml"

permissions:
contents: read

jobs:
e2e-all:
runs-on: [self-hosted, linux]
steps:
- name: 🩹 Safe config for 💩 DNS
run: |
sed 's/options /options use-vc single-request attempts:5 /' < /etc/resolv.conf > /etc/resolv.conf.new
cat /etc/resolv.conf.new > /etc/resolv.conf
- name: ⬇️ Checkout repository
uses: actions/checkout@v4
- name: ⬇️ Install kubectl
uses: azure/setup-kubectl@v4
with:
version: v1.32.9
- name: ⬇️ Install helm
uses: azure/setup-helm@v4
- name: ⬇️ Install kustomize
uses: imranismail/setup-kustomize@v1
with:
kustomize-version: v4.5.7
- name: 🔎 Check IP
id: ip
run: |
echo "ip=`curl -s https://api.ipify.org`" | tee $GITHUB_OUTPUT
- name: 🔐 Set ak/sk name based on runner region
run: .github/scripts/runneraksk.sh
- name: 🧹 Frieza
uses: outscale/frieza-github-actions/frieza-clean@master
with:
access_key: ${{ secrets[env.OSC_ACCESS_KEY_NAME] }}
secret_key: ${{ secrets[env.OSC_SECRET_KEY_NAME] }}
region: ${{ env.OSC_REGION }}
- name: 👷 Deploy management cluster
id: management
uses: ./github_actions/deploy_cluster
with:
RUNNER_NAME: ${{ runner.name }}
OKS_ACCESS_KEY: ${{ secrets.OSC_ACCESS_KEY_OKS }}
OKS_SECRET_KEY: ${{ secrets.OSC_SECRET_KEY_OKS }}
OKS_REGION: ${{ vars.OKS_REGION }}
OSC_ACCESS_KEY: ${{ secrets[env.OSC_ACCESS_KEY_NAME] }}
OSC_SECRET_KEY: ${{ secrets[env.OSC_SECRET_KEY_NAME] }}
OSC_REGION: ${{ env.OSC_REGION }}
CLUSTER_NAME: "caposc-all"
IMAGE_NAME: ${{ vars.IMG_MANAGEMENT }}
IMAGE_ACCOUNT_ID: ${{ secrets[env.OSC_ACCOUNT_ID_NAME] }}
CERT_MANAGER: "true"
- name: ⬇️ Install Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: 📦 Build and push Docker image
run: |
docker login ${{ vars.REGISTRY }} -u admin -p ${{ secrets.HARBOR_ADMIN_PASSWORD }}
sudo apt-get update
sudo apt install -y docker-buildx-plugin
make docker-buildx
make docker-push
env:
IMG: ${{ vars.REGISTRY }}/outscale/cluster-api-outscale-controllers:${{ github.sha }}
DOCKER_BUILDKIT: 1
- name: 🔎 Preloader snapshot
id: preloader
uses: outscale/k8s-image-preloader/github_actions/preloader_snapshot@main
with:
KUBECONFIG: ${{ steps.management.outputs.KUBECONFIG }}
OSC_ACCESS_KEY: ${{ secrets[env.OSC_ACCESS_KEY_NAME] }}
OSC_SECRET_KEY: ${{ secrets[env.OSC_SECRET_KEY_NAME] }}
OSC_REGION: ${{ env.OSC_REGION }}
CSI: true
- name: 🔐 Create CAPOSC ns and credentials
run: make credential
shell: bash
env:
KUBECONFIG: "${{ github.workspace }}/${{ steps.management.outputs.KUBECONFIG }}"
OSC_ACCESS_KEY: ${{ secrets[env.OSC_ACCESS_KEY_NAME] }}
OSC_SECRET_KEY: ${{ secrets[env.OSC_SECRET_KEY_NAME] }}
- name: 🧪 Launch e2e tests
run: |
from=`echo ${{ vars.IMG_UPGRADE_FROM }} | sed 's/.*kubernetes-\(v[^-]*\)-.*/\1/'`
to=`echo ${{ vars.IMG_UPGRADE_TO }} | sed 's/.*kubernetes-\(v[^-]*\)-.*/\1/'`
export KUBERNETES_VERSION=$from
export KUBERNETES_VERSION_UPGRADE_FROM=$from
export KUBERNETES_VERSION_UPGRADE_TO=$to
E2E_FOCUS=all make e2etest
shell: bash
id: e2etest
env:
KUBECONFIG: "${{ github.workspace }}/${{ steps.management.outputs.KUBECONFIG }}"
CCM_OSC_ACCESS_KEY: ${{ secrets[env.OSC_ACCESS_KEY_NAME] }}
CCM_OSC_SECRET_KEY: ${{ secrets[env.OSC_SECRET_KEY_NAME] }}
CCM_OSC_REGION: ${{ env.OSC_REGION }}
IMG: ${{ vars.REGISTRY }}/outscale/cluster-api-outscale-controllers:${{ github.sha }}
IMG_UPGRADE_FROM: ${{ vars.IMG_UPGRADE_FROM }}
IMG_UPGRADE_TO: ${{ vars.IMG_UPGRADE_TO }}
PRELOAD_SNAPSHOT_ID: ${{ steps.preloader.outputs.SNAPSHOT_ID }}
- name: 📝 Get CAPOSC state/logs
run: |
echo "**** pod state"
kubectl describe po -n cluster-api-provider-outscale-system
echo "**** pod logs"
make logs-capo
if: ${{ failure() && steps.e2etest.conclusion == 'failure' }}
shell: bash
env:
KUBECONFIG: "${{ github.workspace }}/${{ steps.management.outputs.KUBECONFIG }}"
CAPO_NAMESPACE: cluster-api-provider-outscale-system
- name: 📝 Get cluster api logs
run: make logs-capi
if: ${{ failure() && steps.e2etest.conclusion == 'failure' }}
shell: bash
env:
KUBECONFIG: "${{ github.workspace }}/${{ steps.management.outputs.KUBECONFIG }}"
CAPI_NAMESPACE: capi-kubeadm-bootstrap-system
12 changes: 6 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: build
name: Check build & lint

on:
pull_request:
branches: [main]
Expand All @@ -13,11 +14,10 @@ on:
- "!helm/**"
- "Makefile"
- "!docs/src/**"
- "!hack/json-format/*.sh"
- "!hack/json-format/src/*.rs"
- "!hack/json-format/Makefile"
- "!hack/json-format/Cargo.*"
- "!hack/json-format/tests/*.rs"

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down
89 changes: 0 additions & 89 deletions .github/workflows/dispatch_image_builder.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: clean-image
name: docker-prune

on:
schedule:
Expand All @@ -7,15 +7,15 @@ jobs:
clean-image:
runs-on: ubuntu-latest
steps:
- name: Checkout cluster-api-outscale
uses: actions/checkout@v4
- name: ⬇️ Checkout cluster-api-outscale
uses: actions/checkout@v5
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Launch image-builder
- name: 🧹 Prune docker cache
run: |
pip3 install -r hack/cleanup/requirements.txt
python3 hack/cleanup/cleanup_oapi.py --days $DAYS --owner $OWNER --imageNamePattern "^(ubuntu|centos)-[0-9.]+-[0-9.]+-kubernetes-v[0-9]+.[0-9]{2}.[0-9]+-[0-9]{4}-[0-9]{2}-[0-9]{2}$" --imageNameFilterPath $GITHUB_WORKSPACE/hack/cleanup/keep_image
docker buider prune
docker image prune
shell: bash
env:
OSC_ACCESS_KEY: ${{secrets.OSC_OPENSOURCE_ACCESS_KEY}}
Expand Down
25 changes: 3 additions & 22 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,9 @@ on:
- "!helm/**"
- "Makefile"
- "!docs/src/**"
- "!hack/json-format/*.sh"
- "!hack/json-format/src/*.rs"
- "!hack/json-format/Makefile"
- "!hack/json-format/Cargo.*"
- "!hack/json-format/tests/*.rs"
push:
branches:
- 'main'
paths:
- "**.go"
- "**.yaml"
- "!capm.yaml"
- "!osc-secret.yaml"
- "!example/**.yaml"
- "!helm/**"
- "Makefile"
- "!docs/src/**"
- "!hack/json-format/*.sh"
- "!hack/json-format/src/*.rs"
- "!hack/json-format/Makefile"
- "!hack/json-format/Cargo.*"
- "!hack/json-format/tests/*.rs"

permissions:
contents: read

jobs:
docker:
Expand Down
98 changes: 0 additions & 98 deletions .github/workflows/json-format-pull-request.yaml

This file was deleted.

Loading
Loading