Skip to content

Commit

Permalink
Merge #833: Allow contributors to easily run CI locally with act
Browse files Browse the repository at this point in the history
006193f feat: Support running CI locally with `act` (Andrew Ahlers)

Pull request description:

  Disable problematic jobs that involve Github Actions caching or `cross` whenever the environment is set to ACT. This allows running the CI pipeline locally and hopefully speeds up PR cycle times by reducing unexpected CI pipeline results.

  ## Motivation

  The CI pipeline does not run until maintainer approval. This allows an easy path for contributors to test out the CI pipeline locally and avoid unexpected results. I personally kept hitting issues here due to MSRV always throwing me off

  ## Potential issues

  - `act` does not support Github Actions caching feature which is used in the `fuzz` workflow so I simply disabled it if `act` is detected.

  - the `cross` workflow is similarly disabled. I kept hitting `sh: 1: cargo: not found` (see: cross-rs/cross#260). I tried a few different workaround but had no success.

  I'm hoping this is acceptable as it still improves the local testing situation and covers the `Tests` workflow

ACKs for top commit:
  apoelstra:
    ACK 006193f
  Kixunil:
    ACK 006193f

Tree-SHA512: 079d50276161ef2c7d61e41d8f47126b8def41ea61f4560be03950e6e4e07ae8bb67ab22ac8f0e46e5e5e3406b64c1de4bb2c62526c36b82db962842ffc377ca
  • Loading branch information
apoelstra committed Feb 18, 2022
2 parents 04787d4 + 006193f commit 1871c3a
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions .actrc
@@ -0,0 +1 @@
-e contrib/act/event.json
2 changes: 2 additions & 0 deletions .github/workflows/fuzz.yml
Expand Up @@ -5,6 +5,7 @@ on: [push, pull_request]
jobs:

fuzz:
if: ${{ !github.event.act }}
runs-on: ubuntu-20.04
env:
HFUZZ_BUILD_ARGS: "--features honggfuzz_fuzz"
Expand Down Expand Up @@ -41,6 +42,7 @@ jobs:
path: executed_${{ matrix.fuzz_target }}

verify-execution:
if: ${{ !github.event.act }}
needs: fuzz
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/rust.yml
Expand Up @@ -64,6 +64,7 @@ jobs:

Cross:
name: Cross testing
if: ${{ !github.event.act }}
runs-on: ubuntu-latest
steps:
- name: Checkout Crate
Expand Down Expand Up @@ -101,7 +102,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
run: sudo apt update && sudo apt install qemu-system-arm gcc-arm-none-eabi
run: sudo apt update && sudo apt install -y qemu-system-arm gcc-arm-none-eabi
- name: Checkout Toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -114,6 +114,15 @@ Please try to address them, otherwise your PR might get closed without merging
after a longer time of inactivity. If your PR isn't ready for review yet please
mark it by prefixing the title with `WIP: `.

### CI Pipeline

The CI pipeline requires approval before being run on each MR.

In order to speed up the review process the CI pipeline can be run locally using
[act](https://github.com/nektos/act). The `fuzz` and `Cross` jobs will be
skipped when using `act` due to caching being unsupported at this time. We do
not *actively* support `act` but will merge PRs fixing `act` issues.

## Policy on Altcoins/Altchains

Patches which add support for non-Bitcoin cryptocurrencies by adding constants
Expand Down
3 changes: 3 additions & 0 deletions contrib/act/event.json
@@ -0,0 +1,3 @@
{
"act": true
}

0 comments on commit 1871c3a

Please sign in to comment.