github actions added #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI/CD Pipeline for Book Tracker API | |
| on: | |
| push: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Step 1: Checkout the code | |
| - name: Checkout code | |
| uses: actions/[email protected] | |
| # Step 2: Set up Go environment | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: 1.24 | |
| # Step 3: Install dependencies | |
| - name: Install Dependencies | |
| run: | | |
| go mod tidy | |
| - name: Docker Compose Action | |
| uses: hoverkraft-tech/[email protected] | |
| with: | |
| compose-file: "docker-compose.yml" | |
| # Step 6: Setup Keploy | |
| - name: Setup Keploy | |
| run: | | |
| curl --silent -L https://keploy.io/ent/install.sh | bash | |
| # Step 7: Run Keploy Test Suite | |
| - name: Run Keploy Test Suite | |
| run: | | |
| export KEPLOY_API_KEY=Ee6Tq2LOx77IhixbEg== | |
| keploy test-suite --app=03d24177-315c-4ee1-a3ac-64ed0ab38567 --base-path http://localhost:8080/books --cloud | |
| # Step 8: Tear down Docker Compose after tests | |
| - name: Tear down Docker Compose | |
| run: | | |
| docker-compose down |