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

Added Github Actions for testing PRs for Docker Builds (Issue #83) #85

Merged
merged 1 commit into from
May 23, 2024

Conversation

Sak1012
Copy link
Member

@Sak1012 Sak1012 commented May 14, 2024

This pull request introduces a new GitHub Actions workflow (docker-pr.yml) to automate the building of Docker images for the eventyay-tickets project. The workflow is triggered whenever a pull request is opened or updated targeting the development or main branches. Additionally, it checks and installs Python dependencies before building the Docker image.

Changes Made

  • Added a new workflow file docker-pr.yml in the .github/workflows directory.
  • Configured the workflow to check and install Python dependencies using the requirements.txt file located in the src directory.
  • Built the Docker image using the installed dependencies.
  • Ensured that the workflow only runs for pull requests targeting the development or main branches.
  • Tested the workflow locally to ensure proper functionality.

ScreenShots

These are screenshots of example tests that were tested with my local fork of eventyay-tickets

Test Getting triggered on a pull-request made to the development branch of my local repository.
Screenshot 2024-05-15 at 00 34 17

Success message of the test while trying to create a PR in-between to local branches aimed at development branch
Screenshot 2024-05-14 at 15 28 56

@marcoag
Copy link
Member

marcoag commented May 14, 2024

@Sak1012 Thanks a lot for the PR, I had a look at commit 19975bb and it looks pretty good. Unfortunately we had to run a hard reset on the development branch due to a messed up merge, would you mind cherry picking the relevant changes and opening a PR against the current development branch?

If you have trouble doing it or you prefer I can do it myself, I just didn't want to steal the authorship of this PR from you ;)

Copy link
Member

@marcoag marcoag left a comment

Choose a reason for hiding this comment

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

Please open a new PR against current development branch.

norbusan
norbusan previously approved these changes May 16, 2024
Copy link
Member

@norbusan norbusan left a comment

Choose a reason for hiding this comment

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

LGTM, we will see in reality how well it fares.

I would probably fix a certain Python version, the one that is required by ticekts.

@norbusan norbusan dismissed their stale review May 16, 2024 11:31

Build fails

Copy link
Member

@norbusan norbusan left a comment

Choose a reason for hiding this comment

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

This PR fails.
Have you tried a local installation before with the same recipe?
With Python 3.12 being automatically selected, it breaks. Same with 3.11 which I tried.

I fear that the very old dependencies, in particular for psycopg2 will make it difficult to automatize it.

We need osycopg2 builds for the version in the requirements for some version of Python we want to use.

I guess the best way forward is:

  • update psycopg2 to 2.9.9 which is the latest available version
  • test that eventyay-tickets works with that
  • bump the requirements version

and after all that is done, we can have github actions tests.

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
Copy link
Member

Choose a reason for hiding this comment

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

Can we use 3.8 here as we do with all other versions and tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have updated the Version to "3.8" and the build is successful, please take a look

image

@mariobehling
Copy link
Member

Ok, I am merging this to test.

@mariobehling mariobehling merged commit 8c3ed53 into fossasia:development May 23, 2024
1 of 5 checks passed
@Sak1012 Sak1012 deleted the Docker-PR branch May 24, 2024 06:26
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

4 participants