Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move CI to GitHub Actions #4921

Open
wants to merge 17 commits into
base: staging
Choose a base branch
from

Conversation

jippi
Copy link
Contributor

@jippi jippi commented Feb 11, 2024

👋 Hello friends,

This PR moves CI from Circle CI to GitHub Actions and introduces a couple of new steps

  • db tests that migrations apply cleanly against supported databases
    • mariadb:latest
    • mariadb:11
    • mariadb:10
    • mysql:latest
    • mysql:8.3
    • mysql:8.0
    • postgres:16
    • postgres:15
    • postgres:14
  • php tests that

Also lays the foundation for future tests using the various databases directly (or at all) in the future.

Further more, using GitHub Actions makes it easier for forks (since they likely also use GItHub) and it makes the testing output and status much more accessible to contributors directly, without going to 3rd party tools.

There are many opportunities to expand and improve our CI experience, having it managed in GitHub Actions will be a first important step for that.

Questions

  1. Do we want to use Pint for code style? Something else? nothing at all?

@jippi jippi changed the base branch from dev to staging February 11, 2024 13:38
@jippi jippi force-pushed the jippi/move-ci-to-github-actions branch 3 times, most recently from 744ea98 to 76a9e25 Compare February 11, 2024 13:45
@jippi jippi force-pushed the jippi/move-ci-to-github-actions branch from 76a9e25 to a8ee68e Compare February 11, 2024 13:45
@@ -27,6 +27,7 @@
"laravel/passport": "^11.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^4.2",
"lcobucci/clock": "^3.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like 3.1 added PHP 8.2 support and 3.2 added PHP 8.3 supporting

With basically nothing else happening between those releases otherwise

@jippi jippi force-pushed the jippi/move-ci-to-github-actions branch from fb93eb8 to 9967294 Compare February 11, 2024 16:21
@jippi jippi force-pushed the jippi/move-ci-to-github-actions branch from 9967294 to bad45b2 Compare February 11, 2024 16:24
@jippi jippi requested a review from dansup as a code owner March 6, 2024 21:00
indent_size = 2

[*.{sh,envsh,env,env*}]
indent_style = space
indent_size = 4

# ShellCheck config
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is just sorting keys alphabetically


- run: php artisan migrate --force

migrations-postgresql:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these can be merged? They do the same thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is a couple of differences between the MySQL and PostgreSQL jobs - and while it can be merged, I think the complexity of that isn't worth taking on vs a more verbose, but simple-to-follow step. CI should be as dumb as possible to keep it easy to debug and flexible.

  • Different "health checks"
  • Different DB "environment keys" (not PF ones, but the DB container image)

COMPOSER_VERSION: 2.7.1

jobs:
test:
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd probably recommend splitting this into a lint and test jobs, such that you can fail the workflow fast on linting issues? Though you are using fail-fast false below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I merged the two into for a couple of reasons:

  1. Avoiding confusing "cause and effect" situations where a syntax error caused many pipelines to fail (and having to figure out which) - or tests failing under PHP 8.x fail but not on PHP 8.y due to some syntax/issue.
  2. There is no point in running tests (or its pipeline) if there is a syntax error, so it shortens full pipeline runtime from end-to-end.
  3. Fewer CI jobs kicking off at the same time, to keep the number of CI jobs ~low.

I'm going to pull out the pint part for now though, as @dansup seem to want to do this a different way / timing.

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.

None yet

2 participants