Skip to content

change the test scirpte for export testing #7

change the test scirpte for export testing

change the test scirpte for export testing #7

Workflow file for this run

name: CI
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_PASSWORD: testpass
POSTGRES_USER: testuser
POSTGRES_DB: graft_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.24'
- name: Wait for PostgreSQL
run: |
until pg_isready -h localhost -p 5432 -U testuser; do
echo "Waiting for PostgreSQL..."
sleep 2
done
- name: Build project
run: |
go build -o graft .
chmod +x graft
ls -la graft
- name: Verify build
run: |
./graft --version
echo "Graft binary built successfully"
- name: Prepare test script
run: |
chmod +x test/github-workflow-test.sh
chmod +x test/db-helper.sh
ls -la test/
- name: Run integration tests
env:
DATABASE_URL: postgres://testuser:testpass@localhost:5432/graft_test?sslmode=disable
run: |
cd ${{ github.workspace }}
./test/github-workflow-test.sh