diff --git a/.github/workflows/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml new file mode 100644 index 0000000000..15a4883e11 --- /dev/null +++ b/.github/workflows/codeql-analysis.yaml @@ -0,0 +1,65 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ master, 'release-**' ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master, 'release-**' ] + schedule: + - cron: '0 */24 * * *' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'go' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] + # Learn more about CodeQL language support at https://git.io/codeql-language-support + + steps: + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.18 + id: go + + - name: Checkout repository + uses: actions/checkout@v3 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + run: | + make all + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index c5efce058d..a40ed10fb9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,6 +21,6 @@ jobs: AWS EBS CSI Driver ## CHANGELOG - See [CHANGELOG](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/CHANGELOG-0.x.md) for full list of changes + See [CHANGELOG](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/CHANGELOG.md) for full list of changes draft: false prerelease: false diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml new file mode 100644 index 0000000000..3716de57ac --- /dev/null +++ b/.github/workflows/unit-tests.yaml @@ -0,0 +1,32 @@ +name: Unit Tests + +on: + push: +jobs: + buildx: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, windows-latest ] + steps: + - id: go-cache-paths + run: | + echo "::set-output name=go-build::$(go env GOCACHE)" + echo "::set-output name=go-mod::$(go env GOMODCACHE)" + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Go 1.17 + uses: actions/setup-go@v3 + with: + go-version: 1.17 + + - name: Go Build Cache + uses: actions/cache@v2 + with: + path: ${{ steps.go-cache-paths.outputs.go-build }} + key: ${{ runner.os }}-cache-${{ hashFiles('**/go.sum') }} + + - name: Run tests + run: | + go test -v ./cmd/... ./pkg/... \ No newline at end of file diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml new file mode 100644 index 0000000000..edc44fd9c6 --- /dev/null +++ b/.github/workflows/verify.yaml @@ -0,0 +1,30 @@ +name: Verify + +on: + push: +jobs: + buildx: + runs-on: ubuntu-latest + steps: + - id: go-cache-paths + run: | + echo "::set-output name=go-build::$(go env GOCACHE)" + echo "::set-output name=go-mod::$(go env GOMODCACHE)" + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Go 1.17 + uses: actions/setup-go@v3 + with: + go-version: 1.17 + + - name: Go Build Cache + uses: actions/cache@v2 + with: + path: ${{ steps.go-cache-paths.outputs.go-build }} + key: ${{ runner.os }}-cache-${{ hashFiles('**/go.sum') }} + + # Runs ./hack/verify-all + - name: Run make verify + run: | + make verify \ No newline at end of file diff --git a/pkg/mounter/mock_mount_windows.go b/pkg/mounter/mock_mount_windows.go index 251bc0fe49..e3c5048dbe 100644 --- a/pkg/mounter/mock_mount_windows.go +++ b/pkg/mounter/mock_mount_windows.go @@ -1,6 +1,3 @@ -//go:build windows -// +build windows - // Code generated by MockGen. DO NOT EDIT. // Source: ./pkg/mounter/safe_mounter_windows.go @@ -241,6 +238,20 @@ func (mr *MockProxyMounterMockRecorder) MountSensitiveWithoutSystemd(source, tar return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MountSensitiveWithoutSystemd", reflect.TypeOf((*MockProxyMounter)(nil).MountSensitiveWithoutSystemd), source, target, fstype, options, sensitiveOptions) } +// MountSensitiveWithoutSystemdWithMountFlags mocks base method. +func (m *MockProxyMounter) MountSensitiveWithoutSystemdWithMountFlags(source, target, fstype string, options, sensitiveOptions, mountFlags []string) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MountSensitiveWithoutSystemdWithMountFlags", source, target, fstype, options, sensitiveOptions, mountFlags) + ret0, _ := ret[0].(error) + return ret0 +} + +// MountSensitiveWithoutSystemdWithMountFlags indicates an expected call of MountSensitiveWithoutSystemdWithMountFlags. +func (mr *MockProxyMounterMockRecorder) MountSensitiveWithoutSystemdWithMountFlags(source, target, fstype, options, sensitiveOptions, mountFlags interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MountSensitiveWithoutSystemdWithMountFlags", reflect.TypeOf((*MockProxyMounter)(nil).MountSensitiveWithoutSystemdWithMountFlags), source, target, fstype, options, sensitiveOptions, mountFlags) +} + // Rescan mocks base method. func (m *MockProxyMounter) Rescan() error { m.ctrl.T.Helper()