|
| 1 | +name: E2E Integration Tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [e2e] |
| 6 | + pull_request: |
| 7 | + branches: [e2e] |
| 8 | + |
| 9 | +jobs: |
| 10 | + e2e-tests: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Checkout code |
| 15 | + uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - name: Set up Go |
| 18 | + uses: actions/setup-go@v4 |
| 19 | + with: |
| 20 | + go-version: "1.23" |
| 21 | + |
| 22 | + - name: Set up Docker Buildx |
| 23 | + uses: docker/setup-buildx-action@v3 |
| 24 | + |
| 25 | + - name: Verify Docker Compose |
| 26 | + run: | |
| 27 | + docker --version |
| 28 | + docker compose version |
| 29 | +
|
| 30 | + - name: Cache Go modules |
| 31 | + uses: actions/cache@v3 |
| 32 | + with: |
| 33 | + path: | |
| 34 | + ~/.cache/go-build |
| 35 | + ~/go/pkg/mod |
| 36 | + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} |
| 37 | + restore-keys: | |
| 38 | + ${{ runner.os }}-go- |
| 39 | +
|
| 40 | + - name: Install dependencies |
| 41 | + run: | |
| 42 | + go mod download |
| 43 | + cd e2e && go mod download |
| 44 | +
|
| 45 | + - name: Build mpcium binary |
| 46 | + run: | |
| 47 | + go build -o mpcium ./cmd/mpcium |
| 48 | +
|
| 49 | + - name: Build mpcium-cli binary |
| 50 | + run: | |
| 51 | + go build -o mpcium-cli ./cmd/mpcium-cli |
| 52 | +
|
| 53 | + - name: Make binaries executable and add to PATH |
| 54 | + run: | |
| 55 | + chmod +x mpcium mpcium-cli |
| 56 | + sudo mv mpcium /usr/local/bin/ |
| 57 | + sudo mv mpcium-cli /usr/local/bin/ |
| 58 | +
|
| 59 | + - name: Verify binaries are available |
| 60 | + run: | |
| 61 | + which mpcium |
| 62 | + which mpcium-cli |
| 63 | + mpcium --version || echo "mpcium binary ready" |
| 64 | + mpcium-cli --version || echo "mpcium-cli binary ready" |
| 65 | +
|
| 66 | + - name: Run E2E tests |
| 67 | + run: | |
| 68 | + cd e2e |
| 69 | + go test -v -timeout=600s -run TestKeyGeneration |
| 70 | + env: |
| 71 | + DOCKER_BUILDKIT: 1 |
| 72 | + |
| 73 | + - name: Cleanup Docker containers |
| 74 | + if: always() |
| 75 | + run: | |
| 76 | + cd e2e |
| 77 | + docker compose -f docker-compose.test.yaml down -v || true |
| 78 | + docker system prune -f || true |
| 79 | +
|
| 80 | + - name: Upload test logs |
| 81 | + if: failure() |
| 82 | + uses: actions/upload-artifact@v4 |
| 83 | + with: |
| 84 | + name: e2e-test-logs |
| 85 | + path: e2e/logs/ |
| 86 | + retention-days: 7 |
| 87 | + |
0 commit comments