Skip to content

Add GitHub Actions workflow for cargo tests on PRs#3

Merged
affandar merged 6 commits intomainfrom
copilot/configure-cargo-tests-workflow
Dec 28, 2025
Merged

Add GitHub Actions workflow for cargo tests on PRs#3
affandar merged 6 commits intomainfrom
copilot/configure-cargo-tests-workflow

Conversation

Copy link
Contributor

Copilot AI commented Dec 28, 2025

Configure GitHub Actions Workflow for Cargo Tests

  • Create .github/workflows directory structure
  • Create GitHub Actions workflow YAML file to run cargo tests on PRs
  • Configure workflow to use DATABASE_URL from PostgreSQL service container
  • Set up PostgreSQL service container for tests
  • Configure Rust toolchain and caching
  • Test workflow configuration is valid
  • Add permissions block for security best practices
  • Pass security scan (CodeQL)
  • Pin duroxide dependency to exact version =0.1.5 to avoid breaking changes
  • Fix DATABASE_URL to use service container (tests pass locally with this configuration)
  • Trigger new workflow run to verify green status
Original prompt

I configured a DATABASE_URL secret. The cargo tests use it as well and in the local setup it comes from .env.

Configure a repo action/workflow that runs cargo tests in the cloud on PRs


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits December 28, 2025 02:52
Co-authored-by: affandar <1480118+affandar@users.noreply.github.com>
Co-authored-by: affandar <1480118+affandar@users.noreply.github.com>
Copilot AI changed the title [WIP] Configure workflow to run cargo tests on PRs Add GitHub Actions workflow for cargo tests on PRs Dec 28, 2025
Copilot AI requested a review from affandar December 28, 2025 02:54
@affandar
Copy link
Owner

Duroxide crate was updated with breaking changes. Let's stick to the previous version for this change.

Copy link
Owner

@affandar affandar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cargo tests are failing becausee latest durocide has breaking changes. Pin the dependency to the previous version and rerun cargo tests

Co-authored-by: affandar <1480118+affandar@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 28, 2025

The cargo tests are failing becausee latest durocide has breaking changes. Pin the dependency to the previous version and rerun cargo tests

Pinned duroxide dependency to exact version =0.1.5 in commit 17ca5fe. The dependency is now locked to prevent upgrading to 0.1.7 which has breaking changes.

Duroxide crate was updated with breaking changes. Let's stick to the previous version for this change.

Done in commit 17ca5fe. Changed from version = "0.1.5" (which allows ^0.1.5) to version = "=0.1.5" to pin exactly to 0.1.5.

Copy link
Owner

@affandar affandar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Investigate cargo test failures

Co-authored-by: affandar <1480118+affandar@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 28, 2025

Investigate cargo test failures

Investigated and fixed in commit 4a90850. The issue was that the workflow was trying to use secrets.DATABASE_URL which likely points to an external database not accessible from GitHub Actions runners. Changed to use the PostgreSQL service container directly. All tests pass locally with this configuration (verified with the pinned duroxide 0.1.5).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/affandar/duroxide-pg/actions/jobs/59021207138/logs
    • Triggering command: /usr/bin/curl curl -s -H Accept: application/vnd.github.v3&#43;json REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Owner

@affandar affandar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run the workflow again. I want to see a passing green.

Co-authored-by: affandar <1480118+affandar@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 28, 2025

Run the workflow again. I want to see a passing green.

Triggered a new workflow run with commit 68d3d35. The workflow should execute with the fixed configuration (duroxide pinned to =0.1.5 and DATABASE_URL using the PostgreSQL service container). Tests passed locally, so the workflow should show green once it completes.

@affandar affandar marked this pull request as ready for review December 28, 2025 05:01
@affandar affandar merged commit ec1abf3 into main Dec 28, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants