-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from quickstrom/docs-how-tos
Add CI guide
- Loading branch information
Showing
3 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ and run Quickstrom already. | |
.. toctree:: | ||
|
||
broken-links | ||
testing-in-github-actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Testing in GitHub Actions | ||
========================= | ||
|
||
Quickstrom can be run in a continuous integration (CI) workflow to find problems | ||
early. Here's a configuration for GitHub Actions that checks a website on every | ||
commit to the ``main`` branch. It's based on Domen Kožar's gist. [#original]_ | ||
|
||
.. code-block:: yaml | ||
name: "Quickstrom integration tests" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2.3.4 | ||
# We use `install-nix-action` and `cachix-action` to quickly install the | ||
# latest Quickstrom from a binary cache. | ||
- uses: cachix/install-nix-action@v12 | ||
- uses: cachix/cachix-action@v8 | ||
with: | ||
name: quickstrom | ||
- run: nix-env -iA quickstrom -f https://github.com/quickstrom/quickstrom/tarball/main | ||
# We install and run Geckodriver in the background, so that we can run | ||
# tests using Firefox. | ||
- run: nix-env -i geckodriver -f https://github.com/NixOS/nixpkgs/tarball/nixos-21.05 | ||
- run: geckodriver& | ||
# Finally, run tests! This assumes there's a file called | ||
# `example.spec.purs` in the root of the GitHub repository. | ||
- run: quickstrom check example.spec.purs https://example.com | ||
Replace the placeholder paths and URLs. | ||
|
||
Next Steps | ||
---------- | ||
|
||
* You might want to run tests in Chrome instead. See :doc:`../topics/checking` for instructions on using other browsers. | ||
* If you'd like to check multiple specs and in multiple browsers, see `matrix configurations <https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix>`_ in the GitHub Actions documentation. | ||
|
||
.. [#original] Domen Kožar wrote the original GitHub Action configuration for `Cachix <https://cachix.org>`__: https://gist.github.com/domenkozar/71135bf7aa6d50d6911fb74f4dcb4bad |