|
1 | 1 | # Skipping a Build |
2 | 2 |
|
3 | | -In some cases, you may want to skip Argos checks for a commit or pull request. |
4 | | -This is especially useful when Argos is configured as a **required status check** in GitHub, but screenshots are not needed (e.g. documentation-only changes, emergency hotfixes). Running Argos in these situations would be unnecessary and could even block your workflow. |
| 3 | +Sometimes you want Argos to report success without running visual tests. |
| 4 | +This is useful when Argos is configured as a required GitHub status check, but you intentionally want to skip screenshots for a commit or pull request. |
5 | 5 |
|
6 | | -To address this, you can use the `skipped` option. |
7 | | -When `skipped: true` is set, **no screenshots are uploaded** and the commit status is immediately marked as **success**. |
| 6 | +A skipped build: |
8 | 7 |
|
9 | | -## When to use `skipped` |
| 8 | +- uploads no screenshots |
| 9 | +- runs no visual comparison |
| 10 | +- immediately marks the commit status as success |
10 | 11 |
|
11 | | -- Documentation changes with no impact on the UI |
12 | | -- Hotfixes where visual testing is not relevant |
13 | | -- Branches or pull requests that don’t require screenshots |
14 | | -- Scheduled builds you want to disable selectively |
| 12 | +## Creating a skipped build |
15 | 13 |
|
16 | | -:::warning |
| 14 | +You can skip a build in two ways. |
17 | 15 |
|
18 | | -Skipping should only be used in exceptional cases. It is not meant to replace regular visual testing. |
| 16 | +### Environment variable |
19 | 17 |
|
20 | | -::: |
| 18 | +Set the environment variable `ARGOS_SKIPPED` to `"true"` in your CI configuration. |
21 | 19 |
|
22 | | -## How to enable skipping |
| 20 | +**GitHub Actions example:** |
23 | 21 |
|
24 | | -You can enable skipping in two ways: |
| 22 | +```yaml title=".github/workflows/ci.yml" |
| 23 | +jobs: |
| 24 | + visual-tests: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v6 |
| 28 | + - uses: actions/setup-node@v6 |
| 29 | + - name: Run tests |
| 30 | + run: npm run visual-tests # or your test command |
| 31 | + env: |
| 32 | + ARGOS_SKIPPED: "true" |
| 33 | +``` |
25 | 34 |
|
26 | | -1. **Environment variable** |
27 | | - Set `ARGOS_SKIPPED` to `"true"` in your CI configuration. |
| 35 | +This reports a successful Argos check without uploading screenshots. |
28 | 36 |
|
29 | | -2. **Configuration option** |
30 | | - Add `skipped: true` in your Argos SDK configuration. |
| 37 | +### Using the CLI |
31 | 38 |
|
32 | | -## GitHub Actions example |
| 39 | +You can also explicitly create a skipped build using the CLI. |
33 | 40 |
|
34 | | -```yaml title="ci.yml" |
| 41 | +```yaml title=".github/workflows/ci.yml" |
35 | 42 | jobs: |
36 | 43 | visual-tests: |
37 | 44 | runs-on: ubuntu-latest |
38 | 45 | steps: |
39 | | - - uses: actions/checkout@v4 |
40 | | - - uses: actions/setup-node@v3 |
41 | | - - name: Run tests |
42 | | - run: npm run visual-tests # or your test command |
43 | | - env: |
44 | | - ARGOS_SKIPPED: "true" # Marks Argos check as "success" without uploading screenshots |
| 46 | + - uses: actions/checkout@v6 |
| 47 | + - uses: actions/setup-node@v6 |
| 48 | + - name: Skip Argos build |
| 49 | + run: npx @argos-ci/cli skip |
45 | 50 | ``` |
| 51 | +
|
| 52 | +This immediately creates a successful Argos build with no visual testing. |
0 commit comments