testing_pull_requests.rst 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. .. _doc_testing_pull_requests:
  2. Testing pull requests
  3. =====================
  4. Many people are developing new features or fixing bugs on GitHub.
  5. To help with engine development, you may be asked to test those pull requests
  6. with a Godot build that includes code from the pull request in question.
  7. Thanks to GitHub Actions, all `pull requests <https://github.com/godotengine/godot/pulls>`__
  8. have continuous builds available. These builds let you try out pull requests
  9. without having to compile anything from source.
  10. Downloading a compiled build
  11. ----------------------------
  12. You can download pull request builds from GitHub Actions. Since only signed in
  13. users may download builds directly from GitHub Actions, the procedure varies
  14. depending on whether you have a GitHub account or not.
  15. .. note::
  16. Due to a GitHub Actions limitation, builds are only available for 90 days
  17. after the pull request was last updated. If you still wish to try a
  18. pull request locally, you can
  19. :ref:`compile the pull request branch from source <doc_testing_pull_requests_compile>`
  20. instead.
  21. If you have a GitHub account
  22. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  23. - Open the pull request page. Click the **Checks** tab near the top of the page:
  24. .. image:: img/testing_pull_requests_access_checks.webp
  25. - Click the **Artifacts** dropdown on the right of the page:
  26. .. image:: img/testing_pull_requests_checks_artifacts.webp
  27. - In the dropdown, click the artifact's name to download it. Remember to scroll
  28. if you cannot see the name of the platform you're looking for:
  29. .. image:: img/testing_pull_requests_checks_artifacts_list.webp
  30. - Extract the ZIP archive then run the executable.
  31. Note that Windows and macOS binaries are **not** code signed.
  32. This means you may have to bypass a security warning before you can run the executable.
  33. On Windows, if you frequently test pull request builds, it may be better to disable
  34. Windows SmartScreen permanently in the Windows security settings.
  35. On macOS, see :ref:`doc_running_on_macos` for instructions on bypassing Gatekeeper.
  36. If you don't have a GitHub account
  37. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  38. If you don't have a GitHub account and can't sign up for one,
  39. you can use the third-party `nightly.link <https://nightly.link>`__ service
  40. to generate a universal download link.
  41. - Open the pull request page. Click the *fork*'s branch name near the top of the page:
  42. .. image:: img/testing_pull_requests_access_fork.png
  43. - Now that you are on the fork's branch page, click the ``.github`` folder at the top of the file list.
  44. Then, click on the ``workflows`` folder (which is inside the ``.github`` folder).
  45. Click the workflow file for the platform you wish to download artifacts for.
  46. *After* clicking on the file (which opens the file view), copy the page URL from your browser's address bar.
  47. - Open the `nightly.link <https://nightly.link>`__ website and paste the URL you just copied
  48. into the text field located below the heading **Paste a GitHub link, get a nightly.link!**.
  49. After pasting the URL, click **Get links** on the right.
  50. If the format of the URL you pasted is correct, you should be presented
  51. with a page like this:
  52. .. image:: img/testing_pull_requests_nightly_link.png
  53. - Click the URL of the artifact you wish to download.
  54. - Extract the ZIP archive then run the executable.
  55. Note that Windows and macOS binaries are not code signed.
  56. This means you may have to bypass a security warning before you can run the executable.
  57. If you frequently test pull request builds, it may be better to disable
  58. Windows SmartScreen or `disable macOS Gatekeeper <https://disable-gatekeeper.github.io/>`__ permanently.
  59. .. _doc_testing_pull_requests_compile:
  60. Compiling a pull request branch from source
  61. -------------------------------------------
  62. This approach may be needed for pull requests that were last updated more than
  63. 90 days ago, or to test on platforms and configurations that are not supported
  64. by Godot's GitHub Actions setup.
  65. Downloading a zipped pull request branch
  66. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  67. - Open the pull request page. Click the *fork*'s branch name near the top of the page:
  68. .. image:: img/testing_pull_requests_access_fork.png
  69. - Now that you are on the fork's branch page, click the green **Code** button on the right of the page
  70. then choose **Download ZIP** in the dropdown:
  71. .. image:: img/testing_pull_requests_fork_zip.png
  72. - Extract the ZIP archive and follow the :ref:`compiling <toc-devel-compiling>` instructions
  73. for your operating system.
  74. Checking out a pull request branch with git
  75. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  76. Alternatively, you can checkout the pull request directly with git:
  77. - Open the pull request page. Note the pull request *number* (``PR_NUMBER``), and the *branch name*
  78. (``BRANCH_NAME``), but without the user name.
  79. .. image:: img/testing_pull_requests_command_line_checkout.webp
  80. - Construct the command using this pattern:
  81. ::
  82. git fetch upstream pull/PR_NUMBER/head:BRANCH_NAME
  83. So for the pull request above, the actual command will be:
  84. ::
  85. # Fetch PR branch locally
  86. git fetch upstream pull/48734/head:editor_file_dialog_filter_sort
  87. - Once the pull request finishes downloading, checkout its branch:
  88. ::
  89. git checkout editor_file_dialog_filter_sort
  90. - And follow the :ref:`compiling <toc-devel-compiling>` instructions for your operating system.