Skip to content

Commit

Permalink
Merge pull request #175 from Onyxmoon/feature/fix-lib-test-workflow
Browse files Browse the repository at this point in the history
build(lib): fix test workflow
  • Loading branch information
Onyxmoon authored Jan 7, 2024
2 parents f7e6f4f + 21c3f00 commit 1fe0bd7
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 4 deletions.
52 changes: 48 additions & 4 deletions .github/workflows/run-tests-lib-folder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,57 @@ jobs:
with:
go-version: 1.21

- name: Build
working-directory: ./lib
- name: Install dependencies for config
working-directory: ./lib/config
run: go mod tidy

- name: Install dependencies for router
working-directory: ./lib/router
run: go mod tidy

- name: Install dependencies for rpc
working-directory: ./lib/rpc
run: go mod tidy

- name: Build config library
working-directory: ./lib/config
run: go build -v ./...

- name: Build router library
working-directory: ./lib/router
run: go build -v ./...

- name: Build rpc library
working-directory: ./lib/rpc
run: go build -v ./...

- name: Test Go Module
- name: Test Go config Module
run: |
cd lib/config
go test ./...
test_exit_code=$? # Capture the exit code of the go test command
if [ $test_exit_code -eq 0 ]; then
echo "Tests passed successfully."
else
echo "Tests failed with exit code $test_exit_code."
exit 1 # Fail the GitHub Actions workflow
fi
- name: Test Go router Module
run: |
cd lib/router
go test ./...
test_exit_code=$? # Capture the exit code of the go test command
if [ $test_exit_code -eq 0 ]; then
echo "Tests passed successfully."
else
echo "Tests failed with exit code $test_exit_code."
exit 1 # Fail the GitHub Actions workflow
fi
- name: Test Go rpc Module
run: |
cd lib
cd lib/rpc
go test ./...
test_exit_code=$? # Capture the exit code of the go test command
if [ $test_exit_code -eq 0 ]; then
Expand Down
4 changes: 4 additions & 0 deletions lib/router/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ require (
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace (
hsfl.de/group6/hsfl-master-ai-cloud-engineering/lib/rpc => ./../rpc
)

0 comments on commit 1fe0bd7

Please sign in to comment.