Skip to content

Adds User registration and login #38

Adds User registration and login

Adds User registration and login #38

name: Application Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
unit-test:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Get dependencies
run: go mod download
- name: Run unit tests
run: go test ./... -v -tags=unit
integration-test:
name: Run Integration Tests
needs: unit-test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Docker Compose
run: |
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Start all services with Docker Compose
run: docker-compose -f ci.docker-compose.yml up -d
- name: Wait for services to be ready
run: |
until [ "$(docker inspect --format='{{.State.Health.Status}}' app)" == "healthy" ]; do
echo "Current health status: $(docker inspect --format='{{.State.Health.Status}}' app)"
sleep 5
done
- name: Run integration tests
run: docker exec app /bin/sh -c "cd /workspace && go test ./... -tags=integration"
- name: Shutdown services
run: docker-compose -f ci.docker-compose.yml down