Skip to content

Commit

Permalink
chore: Adds workflow for build and unit tests (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
gruyaume authored Dec 5, 2023
1 parent 7e49ca8 commit 63b1c65
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright 2023 Canonical Ltd.

name: Master workflow

on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build
run: go build

unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Unit tests
run: go test ./...
2 changes: 1 addition & 1 deletion consumer/nf_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var SendRegisterNFInstance = func(nrfUri, nfInstanceId string, profile models.Nf
retrieveNfInstanceID = resourceUri[strings.LastIndex(resourceUri, "/")+1:]
break
} else {
logger.Consumerlog.Errorf("NRF return wrong status code", status)
logger.Consumerlog.Errorf("NRF return wrong status code: %+v", status)
}
}
return nfProfile, resouceNrfUri, retrieveNfInstanceID, err
Expand Down
4 changes: 2 additions & 2 deletions service/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ func (pcf *PCF) BuildAndSendRegisterNFInstance() (models.NfProfile, error) {
self := context.PCF_Self()
profile, err := consumer.BuildNFInstance(self)
if err != nil {
initLog.Error("Build PCF Profile Error: %v", err)
initLog.Errorf("Build PCF Profile Error: %v", err)
return profile, err
}
initLog.Infof("Pcf Profile Registering to NRF: %v", profile)
Expand Down Expand Up @@ -390,7 +390,7 @@ func (pcf *PCF) RegisterNF() {
}
}

//UpdateNF is the callback function, this is called when keepalivetimer elapsed
// UpdateNF is the callback function, this is called when keepalivetimer elapsed
func (pcf *PCF) UpdateNF() {
KeepAliveTimerMutex.Lock()
defer KeepAliveTimerMutex.Unlock()
Expand Down

0 comments on commit 63b1c65

Please sign in to comment.