chore: Pull upstream changes #200
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
name: CI | |
on: | |
push: | |
branches: [develop] | |
pull_request: | |
types: [opened, synchronize, reopened, ready_for_review] | |
workflow_dispatch: | |
schedule: [cron: "40 1 * * *"] | |
permissions: | |
contents: read | |
env: | |
RUSTFLAGS: -Dwarnings | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: rust version | |
run: | | |
rustc --version | |
cargo --version | |
- uses: taiki-e/install-action@cargo-nextest | |
- name: Run tests | |
run: make test | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: taiki-e/install-action@cargo-hack | |
- name: Install latest nightly | |
run: rustup toolchain install nightly --component rustfmt --allow-downgrade | |
- name: rustfmt | |
run: make check-fmt | |
- name: clippy | |
run: make clippy | |
- name: rustdoc | |
run: make doc | |
- name: feature compatibility | |
run: make check-features | |
wasm: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: rust version | |
run: | | |
rustup default 1.81.0 | |
rustc --version | |
cargo --version | |
- uses: taiki-e/install-action@wasm-pack | |
- name: Install clang | |
run: sudo apt-get install -y clang | |
- name: Run tests in wasm | |
run: make wasm | |
run_tests_with_network: | |
runs-on: ubuntu-latest | |
env: | |
EPOCH_DURATION_MS: 10000 | |
services: | |
postgres: # we need this postgres instance for running a local network with indexer and graphql | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgrespw | |
POSTGRES_DB: iota_indexer_v2 | |
POSTGRES_HOST_AUTH_METHOD: trust | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: rust version | |
run: | | |
rustc --version | |
cargo --version | |
- uses: taiki-e/install-action@cargo-nextest | |
- name: Get the Iota testnet binary and start a local network | |
shell: bash | |
env: | |
IOTA_BINARY_VERSION: "1.39.3" # used for downloading a specific Iota binary versions that matches the GraphQL schema for local network tests | |
IOTA_NETWORK_RELEASE: "testnet" # which release to use | |
run: | | |
ASSET_NAME="iota-$IOTA_NETWORK_RELEASE-v$IOTA_BINARY_VERSION-ubuntu-x86_64.tgz" | |
download_url="https://github.com/iotaledger/iota/releases/download/$IOTA_NETWORK_RELEASE-v$IOTA_BINARY_VERSION/$ASSET_NAME" | |
echo "Downloading testnet binary from $download_url" | |
wget -q $download_url -O iota.tgz | |
tar -zxvf iota.tgz ./iota | |
chmod +x ./iota | |
echo "Starting local network with a faucet, an indexer (port 5432) and GraphQL. Epoch duration is set to $EPOCH_DURATION_MS ms" | |
echo "$(pwd)" >> $GITHUB_PATH # we need it on the path for calling iota move build for some tests | |
./iota start --force-regenesis --with-faucet --with-indexer --with-graphql --pg-port 5432 --pg-db-name iota_indexer_v2 --epoch-duration-ms $EPOCH_DURATION_MS & | |
- name: Run tests that require local network (GraphQL Client and Tx Builder) | |
env: | |
NETWORK: "local" # other expected options are mainnet, testnet, or devnet, or an actual URL to a GraphQL server: http://localhost:port | |
run: | | |
sleep $((EPOCH_DURATION_MS / 1000)) # wait for the network to get to epoch #2 | |
make test-with-localnet |