Skip to content

Adds github actions workflow #45

Adds github actions workflow

Adds github actions workflow #45

Workflow file for this run

name: IBM VPC File CSI Driver
on:
push:
branches:
- master
tags:
- "v[1-9]+.[0-9]+.[0-9]+*"
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ["1.24.1"]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y bc
- name: Install Go dependencies
run: |
make deps
- name: Set up Go workspace
run: |
mkdir -p $(go env GOPATH)/src/github.com/IBM/ibm-vpc-file-csi-driver
rsync -az . $(go env GOPATH)/src/github.com/IBM/ibm-vpc-file-csi-driver
env:
GOPATH: ${{ runner.temp }}/go
- name: Run formatting check
run: make fmt
- name: Run tests
run: |
timeout 300 make test || true
make coverage && touch "Passing" || touch "Failed"
- name: Build driver
run: make driver
- name: Publish coverage
if: success()
env:
GHE_TOKEN: ${{ secrets.GHE_TOKEN }}
run: |
git config credential.helper "store --file=.git/credentials"
echo "https://${GHE_TOKEN}:@github.com" > .git/credentials
./scripts/calculateCoverage.sh
./scripts/publishCoverage.sh
- name: Handle failure
if: failure()
run: ./scripts/handleFailure.sh