Skip to content

Update dependency go to v1.23.3 #139

Update dependency go to v1.23.3

Update dependency go to v1.23.3 #139

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.23'
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@v0.0.18
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@v1.4.2
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: Wait for 1st PVC to be ready
run: |
kubectl wait --for=jsonpath='{.status.phase}'=Bound pvc/pvc-1
- 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