Adds github actions workflow #56
This file contains hidden or 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: IBM VPC File CSI Driver | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - "v[1-9]+.[0-9]+.[0-9]+*" | |
| pull_request: | |
| branches: | |
| - master | |
| # Cancel older runs on the same pull request | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write # needed to push to gh-pages | |
| pull-requests: write # needed to comment on PRs | |
| 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 jq | |
| - 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 sanity tests | |
| run: make test-sanity | |
| - name: Run tests | |
| run: timeout 300 make test | |
| - name: Generate coverage | |
| run: make coverage && touch "Passing" || touch "Failed" | |
| - name: Build driver | |
| run: make driver | |
| - name: Publish coverage | |
| if: success() | |
| env: | |
| GHE_TOKEN: ${{ secrets.GHE_TOKEN }} | |
| GHE_USER: github-actions # required for git clone URL in script | |
| run: | | |
| ./scripts/calculateCoverage.sh | |
| ./scripts/publishCoverage.sh | |
| - name: Handle failure | |
| if: failure() | |
| run: ./scripts/handleFailure.sh |