Skip to content

dear god

dear god #105

Workflow file for this run

name: test
on:
push:
branches:
- '*'
pull_request:
branches:
- main
# test again
jobs:
test:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: false
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests with coverage
run: |
go test -v -coverprofile=coverage.out ./...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.6.0
with:
file: ./coverage.out
token: ${{ secrets.CODECOV_TOKEN }}
- name: Start minikube
id: minikube
uses: medyagh/setup-minikube@latest
with:
cpus: 4
memory: 6000m
- name: Create test PVCs and PODs
run: kubectl apply -f test
- name: Install SSHFS
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: sshfs openssh-client libfuse3-3
- name: Build pv-mounter
run: make bin
- name: Create mountpoint
run: mkdir foo
- name: Check state of test objects
run: |
kubectl get pod
kubectl get pvc
kubectl get storageclass
- name: '[TEST] PVC with RWX access mode'
run: |
./bin/pv-mounter mount default pvc-1 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-1 foo
- name: '[TEST] Unmounted PVC with RWO access mode'
run: |
./bin/pv-mounter mount default pvc-2 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-2 foo
- name: '[TEST] Mounted PVC with RWO access mode'
run: |
./bin/pv-mounter mount --needs-root default pvc-3 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-3 foo
- name: '[TEST] PVC with RWX access mode (NEEDS_ROOT)'
run: |
./bin/pv-mounter mount --needs-root default pvc-4 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-4 foo
- name: '[TEST] Unmounted PVC with RWO access mode (NEEDS_ROOT)'
run: |
./bin/pv-mounter mount default pvc-5 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-5 foo
- name: '[TEST] Mounted PVC with RWO access mode (NEEDS_ROOT)'
run: |
./bin/pv-mounter mount --needs-root default pvc-6 foo
touch foo/bar
ls -l foo/bar
./bin/pv-mounter clean default pvc-6 foo
- name: Delete PODs and PVCs
run: kubectl delete -f test --force --grace-period=0