Conversation
Removed push trigger from CI workflow.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new CI/CD workflow for the SlotSwapper project using GitHub Actions. The workflow automates building, testing, and validation for both backend (Go) and frontend (Node.js) components on pull requests to main, master, and development branches.
- Parallel testing jobs for backend and frontend with a Pre-build stage for setup
- Backend tests with Go 1.24.2 and frontend linting/building with Node.js 20
- Docker image builds for both backend and frontend components
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| go test -v ./... || sleep 15 | ||
| if [ $? -ne 0 ]; then | ||
| echo "Tests failed, but continuing to build image." |
There was a problem hiding this comment.
The exit code check on line 44 will always be 0 because $? captures the exit code of the sleep 15 command, not the test command. The || sleep 15 causes the sleep to run when tests fail, but then the if statement checks the sleep's exit code. This logic doesn't actually fail the build when tests fail, which defeats the purpose of CI testing.
| go test -v ./... || sleep 15 | |
| if [ $? -ne 0 ]; then | |
| echo "Tests failed, but continuing to build image." | |
| go test -v ./... | |
| TEST_EXIT_CODE=$? | |
| if [ $TEST_EXIT_CODE -ne 0 ]; then | |
| echo "Tests failed, but continuing to build image." | |
| sleep 15 |
This pull request introduces a new GitHub Actions workflow for continuous integration, automating the build, test, and lint processes for both backend and frontend components. The workflow ensures that code is properly checked, tested, and built for multiple branches before merging.
Continuous integration workflow setup:
.github/workflows/ci.ymlto define a CI pipeline triggered on pull requests tomain,master, anddevelopmentbranches.Backend automation:
Frontend automation: