Skip to content

Commit

Permalink
feat: add basic github CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fredleger committed Nov 21, 2023
1 parent f236937 commit 095bc2b
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 1 deletion.
66 changes: 66 additions & 0 deletions .github/workflows/werf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI Workflow (werf)

on:
push:
branches:
- ci/werf

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Install asdf
uses: asdf-vm/actions/[email protected]

- name: Install asdf plugins & packages
run: |
asdf plugin add werf https://github.com/MxNxPx/asdf-werf.git
asdf plugin update --all
asdf install
- name: Provision kind Kubernetes cluster
run: |
set -x
curl -Lo /tmp/kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64
chmod +x /tmp/kind
cat <<EOF | /tmp/kind create cluster --config=-
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
EOF
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
sleep 30
kubectl wait --namespace ingress-nginx \
--for=condition=ready pod \
--selector=app.kubernetes.io/component=controller \
--timeout=90s
- name: Run make ci
run: |
make ci
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build: docker-build
ci: lint format unit-tests coverage functional-tests
publish: docker-publish

WERF_RUN = werf run --docker-options="-it --rm --entrypoint=/bin/bash" dev
WERF_RUN = werf run --docker-options="-i --rm --entrypoint=/bin/bash" dev

lint: docker-build
${WERF_RUN} -- -c "bash scripts/lint.sh"
Expand Down

0 comments on commit 095bc2b

Please sign in to comment.