Skip to content

fix(framework): prevent potential nil pointer dereference on NumProcPerNode in MPI plugin #9249

fix(framework): prevent potential nil pointer dereference on NumProcPerNode in MPI plugin

fix(framework): prevent potential nil pointer dereference on NumProcPerNode in MPI plugin #9249

Workflow file for this run

# Copyright The Kubeflow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Unit and Integration Test - Go
on:
- push
- pull_request
jobs:
generate:
name: Generate
runs-on: ubuntu-latest
if: ${{ github.repository == 'kubeflow/trainer' }}
env:
GOPATH: ${{ github.workspace }}/go
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer
- name: Setup Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer/go.mod
- name: Check Go modules
run: |
go mod tidy
git diff --exit-code || (echo 'Please run "go mod tidy" to sync Go modules' && exit 1);
- name: Check auto-generated assets
run: |
make generate
git diff --exit-code || (echo 'Please run "make generate" to generate assets' && exit 1);
- name: Check go fmt
run: |
make fmt
git diff --exit-code || (echo 'Please run "make fmt" to verify gofmt' && exit 1);
- name: Check go vet
run: |
make vet
git diff --exit-code || (echo 'Please run "make vet" to verify govet' && exit 1);
- name: Check golangci lint
run: |
make golangci-lint
test:
name: Test
runs-on: ubuntu-latest
if: ${{ github.repository == 'kubeflow/trainer' }}
env:
GOPATH: ${{ github.workspace }}/go
defaults:
run:
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer
- name: Setup Go
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
go-version-file: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer/go.mod
- name: Run Go unit tests
run: |
make test
- name: Run Go integration tests
run: |
make test-integration
- name: Coveralls report
uses: shogo82148/actions-goveralls@77a1912dca42260ee3e97f61bd13ea7ef40baa93 # v1
continue-on-error: true
with:
path-to-profile: cover.out
working-directory: ${{ env.GOPATH }}/src/github.com/kubeflow/trainer