Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[CI] Switch application build from Travis to GitHub Actions#12090

Merged
pamil merged 1 commit into
Sylius:1.8from
pamil:1.8-application-github-actions
Nov 30, 2020
Merged

[CI] Switch application build from Travis to GitHub Actions#12090
pamil merged 1 commit into
Sylius:1.8from
pamil:1.8-application-github-actions

Conversation

@pamil
Copy link
Copy Markdown
Contributor

@pamil pamil commented Nov 26, 2020

The last PR of the three-part series (#12087, #12089) - switching the application build from Travis CI to GitHub Actions.

Non-JS Behat take around 20% longer (from ~10-11 minutes to ~12-14 minutes) and PHPUnit around 50% longer (from ~1.5m to ~2.5m), I've got no idea what is it caused by, but we've much better parallelization of the builds, so we should be able to get feedback much faster anyway.

@pamil pamil requested a review from a team as a code owner November 26, 2020 13:46
@probot-autolabeler probot-autolabeler Bot added the Maintenance CI configurations, READMEs, releases, etc. label Nov 26, 2020
@pamil pamil changed the base branch from master to 1.8 November 26, 2020 13:46
@pamil pamil force-pushed the 1.8-application-github-actions branch from abee742 to 6a55118 Compare November 26, 2020 13:51
@pamil
Copy link
Copy Markdown
Contributor Author

pamil commented Nov 26, 2020

The execution time will be improved by #12093. Also, there might be some rough edges, we'll probably need to add some conditional waits to our JS Behat suite, but it'll make it less fragile in the end.

@pamil pamil force-pushed the 1.8-application-github-actions branch 2 times, most recently from cead201 to 748d727 Compare November 26, 2020 15:38
Copy link
Copy Markdown
Contributor

@oallain oallain left a comment

Choose a reason for hiding this comment

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

It's a good job 💪 , here are some questions.

I think PHPSpec and PHPUnit should be run separately from Behat, WDYT ?

The check by Easy Coding Standard isn't made by the CI?

Regards 🤝

Comment thread .github/workflows/application.yml Outdated
Comment thread .github/workflows/application.yml Outdated
Comment thread .github/workflows/application.yml Outdated
Comment thread .github/workflows/application.yml Outdated
@pamil pamil force-pushed the 1.8-application-github-actions branch from 748d727 to 9445d11 Compare November 27, 2020 09:46
@pamil pamil force-pushed the 1.8-application-github-actions branch from 9445d11 to 1139d72 Compare November 27, 2020 09:49
@pamil
Copy link
Copy Markdown
Contributor Author

pamil commented Nov 27, 2020

@oallain we can put PHPSpec into static checks, although the name isn't perfect, and it's just a few seconds. PHPUnit is bundled with Behat cause both needs fully set-up application with the database schema created as well (and it takes some time).

As for ECS, we apply coding standard fixes manually from time to time. We don't want to interrupt contributors with failures related to the coding standards.

@oallain
Copy link
Copy Markdown
Contributor

oallain commented Nov 28, 2020

Hello @pamil ,

Thanks for your answer, now I understand better and therefore I share your opinion 😉

So the PR is good for me, just one last idea. You can export Behat logs as artifact to help debug, like :

name: Upload Behat logs as artifact
uses: actions/upload-artifact@v2
if: failure()
with:
    name: Behat logs
    path: etc/build/
    if-no-files-found: ignore

Regards

@pamil pamil merged commit c7dae1e into Sylius:1.8 Nov 30, 2020
@pamil
Copy link
Copy Markdown
Contributor Author

pamil commented Nov 30, 2020

@oallain thanks, it's a good idea, got it in Sylius-Standard PR (Sylius/Sylius-Standard#443), will send a PR here soon as well! :)

@pamil pamil deleted the 1.8-application-github-actions branch November 30, 2020 11:13
pamil added a commit that referenced this pull request Nov 30, 2020
This PR was merged into the 1.8 branch.

Discussion
----------

Thanks to @oallain suggestion in #12090.

Commits
-------

4646b09 [CI] Uploade Behat logs as artifacts if failed

-
name: Run PHPStan
run: vendor/bin/phpstan analyse -c phpstan.neon -l 1 src
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

As you run several independent test commands in the same job, there is a trick to make them run even if the others are failing (while still making the job fail so not using continue-on-error), so that you get the result from all of them in a single execution:

             -
                 name: Install PHP dependencies
                 run: composer update --no-interaction --no-scripts
+                id: end-of-setup

             -
                 name: Check for security vulnerabilities
                 run: symfony security:check
+                if: always() && steps.end-of-setup.outcome == 'success'

             -
                 name: Validate Doctrine mapping
                 run: bin/console doctrine:schema:validate --skip-sync -vvv
+                if: always() && steps.end-of-setup.outcome == 'success'

the always() part of the condition is necessary because any if expression which does not include one of the status check function receives an implicit success() check. The other part is about checking that the setup was successful

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wow, that's cool! I'll open a PR soon.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

that was exactly my reaction when I discovered it 😄

pamil added a commit that referenced this pull request Dec 2, 2020
This PR was merged into the 1.8 branch.

Discussion
----------

Thanks to @stof comments in #12090 and #12089.

Commits
-------

ef06041 [CI] Run all static checks even if one of them fails
35b4820 [CI] Fix requiring specific Symfony version in packages build
GSadee added a commit that referenced this pull request Dec 4, 2020
This PR was merged into the 1.8 branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | 1.8
| Bug fix?        | no
| New feature?    | yes
| BC breaks?      | no
| Deprecations?   | no

Changes related to JS tests
Partially based on @pamil 's #12090 

Commits
-------

f310afd testing assertion helper
c298a38 change helper
703ffb8 renamed name of file for more appropiate and added next function
a4db4cb remove unneded usages, moved helper to proper directory
39eef7c added function to check for open pages
fe50d40 refactor of class and changes related, minor fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintenance CI configurations, READMEs, releases, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants