cleaup #22
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
name: test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
kind: | |
image: kindest/node:v1.30.0 | |
options: --privileged | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
- 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 kubectl | |
run: | | |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" | |
chmod +x kubectl | |
sudo mv kubectl /usr/local/bin/ | |
- name: Set up kind | |
run: | | |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-amd64 | |
chmod +x ./kind | |
sudo mv ./kind /usr/local/bin/kind | |
- name: Create Kubernetes cluster | |
run: kind create cluster --wait 5m | |
- name: Prepare test PVCs and PODs | |
run: | | |
kubectl apply -f pkg/plugin/test/pvc.yaml | |
kubectl apply -f pkg/plugin/test/test-pod.yaml | |
- name: Install SSHFS | |
run: sudo apt-get update && sudo apt-get install -y sshfs --no-install-recommends --no-install-suggests | |
- name: Build pv-mounter | |
run: make bin | |
- name: Create mountpoint | |
run: mkdir foo | |
- name: Run tests | |
run: | | |
./bin/pv-mounter mount default test-pvc foo | |
touch foo/dupa | |
ls -l foo/dupa | |
./bin/pv-mounter clean default test-pvc foo | |
- name: Delete pod and PVC | |
run: | | |
kubectl delete -f pkg/plugin/test/test-pod.yaml | |
kubectl delete -f pkg/plugin/test/pvc.yaml | |
- name: Delete cluster | |
run: kind delete cluster | |