Skip to content

[issue-1122] Removing resolved TODOs #851

[issue-1122] Removing resolved TODOs

[issue-1122] Removing resolved TODOs #851

Workflow file for this run

name: PR validation
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
go_version: '1.21.5'
golangci_version: '1.55.2'
jobs:
lint-test:
name: Validate code and build it
runs-on: ubuntu-22.04
container:
image: ghcr.io/dell/csi-baremetal/csi-baremetal-devkit:latest
env:
EUID: 0
EGID: 0
USER_NAME: root
STDOUT: true
volumes:
- /root:/root
- /tmp:/tmp
- /var/run/docker.sock:/var/run/docker.sock
steps:
- name: Trust My Directory # workaround for https://github.com/actions/checkout/issues/760
run: git config --global --add safe.directory /__w/csi-baremetal-operator/csi-baremetal-operator
- name: Check out code
uses: actions/checkout@v3
- name: Set go_version variable
run: echo "go_version=`echo "$(go version)" | grep -oE '[0-9]{1,}\.[0-9]{1,}\.[0-9]{1,}'`" >> $GITHUB_ENV
- name: Load dep cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: go-dep-${{ env.go_version }}-${{ hashFiles('**/go.sum') }}
restore-keys: go-dep-${{ env.go_version }}-
- name: Load build and linter cache
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/.cache/golangci-lint
key: go-build-${{ env.go_version }}-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/pkg') }}
restore-keys: |
go-build-${{ env.go_version }}-${{ hashFiles('**/go.sum') }}
go-build-${{ env.go_version }}-
- name: Get dependencies
run: go mod download
- name: Lint code
run: GOGC=300 make lint-code
- name: Lint chart
run: make lint-operator-chart
- name: Build binary
run: |
make manager
- name: Run tests
run: |
make test
- name: Coverage
run: make coverage
- name: Upload coverage report to artifacts
uses: actions/upload-artifact@v2.2.1
with:
name: coverage.html
path: ./coverage.html
- name: Upload coverage report to codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.out
flags: unittests
verbose: true
# - name: Generate CRD
# run: |
# make generate-operator-crds
#
# - name: Verify CRD changes
# uses: tj-actions/verify-changed-files@v16.1.1
# id: changed_files
# with:
# files: |
# charts/csi-baremetal-operator/crds/*.yaml
#
# - name: Display changed files
# if: steps.changed_files.outputs.files_changed == 'true'
# run: |
# echo "Changed files: ${{ steps.changed_files.outputs.changed_files }}"
#
# - name: Fail action when files change
# if: steps.changed_files.outputs.files_changed == 'true'
# run: |
# exit 1