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

Split ci action into two jobs to start deploy faster #1073

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

LukasKalbertodt
Copy link
Member

@LukasKalbertodt LukasKalbertodt commented Jan 15, 2024

Fixes #921

Now almost everything that is not required for the test deployment lives in its own job now ("test"). Getting this work was a huge undertaking, because straight forward ways to do that don't work. See #921 for some of the encountered problems. The gist of the current setup is:

  • There is the job build in ci.yml
    • Builds the Tobira binary
    • Creates an artifact with everything required for deployment
    • Creates another artifact with frontend/build
  • There is a job test in ci.yaml
    • It needs: build, so only starts afterwards
    • It downloads both artifacts and the backend cache
    • Runs all tests (cargo test, Playwright, ...)
  • deploy.yml
    • Is now triggered on workflow_run: requested instead of completed. Bc completed would also wait for test job. Instead, we manually wait for the build job to be finished.

Behavior differences after merging this:

  • Deployments should happen faster
  • Deployments also happen if there are test failures
  • The "deploy" step now counts as "failed" if the build step failed. Previously it was shown as "skipped" (which was slightly nicer but oh well)

And as usual with these PRs: the deploy.yml from master is used, so this PR won't properly deploy. In fact the deploy run will fail.

Fixes elan-ev#921

Now almost everything that is not required for the test deployment lives
in its own job now ("test"). Getting this work was a huge undertaking,
because straight forward ways to do that don't work. See elan-ev#921 for some
of the encountered problems. The gist of the current setup is:

- There is the job `build` in `ci.yml`
  - Builds the Tobira binary
  - Creates an artifact with everything required for deployment
  - Creates another artifact with `frontend/build`
- There is a job `test` in `ci.yaml`
  - It `needs: build`, so only starts afterwards
  - It downloads both artifacts and the backend cache
  - Runs all tests (`cargo test`, Playwright, ...)
- `deploy.yml`
  - Is now triggered on `workflow_run: requested` instead of
    `completed`. Bc `completed` would also wait for `test` job. Instead,
    we manually wait for the `build` job to be finished.
@LukasKalbertodt LukasKalbertodt added the changelog:dev Changes primarily for developers label Jan 15, 2024
@github-actions github-actions bot temporarily deployed to test-deployment- January 15, 2024 16:54 Destroyed
@owi92
Copy link
Member

owi92 commented Jan 16, 2024

I'd be lying if I said I understand everything that's going on here. But I didn't see any leftover code and the parts I do understand look good to me.

@owi92
Copy link
Member

owi92 commented Jan 16, 2024

Also I am very happy about this change!

@owi92 owi92 merged commit 8e0b5d6 into elan-ev:master Jan 16, 2024
3 checks passed
@LukasKalbertodt LukasKalbertodt deleted the split-ci branch January 16, 2024 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:dev Changes primarily for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Start test deployment already before Playwright tests are finished in CI
2 participants