Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/doc-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Runs the runnable examples of the documentation (the "Try it" script of the README and the
# Livebook tour) against the public mainnet endpoint they use, so a dead endpoint or a renamed
# function is noticed instead of going stale in the docs.
#
# It depends on a public RPC endpoint, so it runs only on a schedule or by hand and a failure
# here does not block PRs.

name: Documentation examples

on:
schedule:
- cron: "43 6 * * 1" # Mondays 06:43 UTC
workflow_dispatch:

permissions:
contents: read

jobs:
doc-examples:
name: Run documentation examples

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v7

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
otp-version: "29.x"
elixir-version: "1.20"

- name: Restore dependencies cache
uses: actions/cache@v6
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-

- name: Install dependencies
run: mix deps.get

- name: Run documentation examples
run: mix run test/doc_examples.exs README.md guides/tour.livemd
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
- Add `Ethers.Event.eth_transfer_log?/1` and `Ethers.Event.system_address/0` to identify [EIP-7708](https://eips.ethereum.org/EIPS/eip-7708) ETH transfer logs
- Document that `Transfer` event filters also match EIP-7708 ETH transfer logs
- Add `Ethers.Transaction.Unknown` for unregistered transaction types like OP-stack deposit transactions
- Restructure the documentation into a shorter README, topic guides, a cheatsheet and a Livebook tour
- Add `usage-rules.md` for coding agents and ship the guides in the package

### Bug Fixes

Expand Down
20 changes: 16 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,22 @@ Thank you for your interest in contributing to Elixir Ethers! We welcome contrib

1. Ensure you have Elixir installed
2. Clone the repository
3. Install and Run `anvil` (From https://getfoundry.sh/)
4. Install dependencies with `mix deps.get`
5. Prepare the tests (only needs to be ran once) with `mix run test/test_prepare.exs`
6. Run tests with `mix test`
3. Install [`solc`](https://docs.soliditylang.org/en/latest/installing-solidity.html) and
[`jq`](https://jqlang.org/). They compile the test contracts.
4. Install [Foundry](https://getfoundry.sh/) and run `anvil` in a separate terminal
5. Install dependencies with `mix deps.get`
6. Run tests with `mix test`. This compiles the test contracts first
(`mix run test/test_prepare.exs`), so there is no separate preparation step.

## Documentation

- The README is the landing page on GitHub and Hex.pm. The guides in `guides/` are published on
HexDocs, with `guides/getting-started.md` as the first page. Build them with `mix docs`.
- `usage-rules.md` is a short pointer for coding agents which use the library. It only explains
how the library is used and links to the guides, so documentation belongs in the guides.
- The "Try it" script of the README and the Livebook tour are executable. Run them with
`mix run test/doc_examples.exs README.md guides/tour.livemd` (needs network access). A weekly
workflow does the same.

## Pull Request Guidelines

Expand Down
Loading
Loading