Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Ethereum devnet for GHA #69

Merged
merged 8 commits into from
May 27, 2022
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
30 changes: 15 additions & 15 deletions .github/workflows/elixir_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,7 @@ jobs:
matrix:
elixir: [1.13.0]
otp: [24.1.7]
services:
db:
image: postgres:12-alpine
ports: ["5432:5432"]
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: eth_war_game_tool_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v3
- name: Set up Elixir
Expand Down Expand Up @@ -71,14 +59,26 @@ jobs:
cd eth_client/
mkdir -p priv/plts
mix dialyzer --plt

- name: Run tests
env:
ETH_API_KEY: ${{ secrets.ETH_API_KEY }}
ETH_CHAIN_ID: ${{ secrets.ETH_CHAIN_ID }}
ETH_RPC_HOST: ${{ secrets.ETH_RPC_HOST }}
ETH_USER_ADDRESS: ${{ secrets.ETH_USER_ADDRESS }}
ETH_USER_PK: ${{ secrets.ETH_USER_PK }}
run: |
source .envrc
cd eth_client/
mix test

- name: Code Coverage
env:
ETH_API_KEY: ${{ secrets.ETH_API_KEY }}
ETH_CHAIN_ID: ${{ secrets.ETH_CHAIN_ID }}
ETH_RPC_HOST: ${{ secrets.ETH_RPC_HOST }}
ETH_USER_ADDRESS: ${{ secrets.ETH_USER_ADDRESS }}
ETH_USER_PK: ${{ secrets.ETH_USER_PK }}
run: |
source .envrc
cd eth_client/
mix coveralls
- name: Run dialyzer
Expand Down
2 changes: 1 addition & 1 deletion eth_client/lib/eth_client/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ defmodule EthClient.Application do
private_key: System.fetch_env!("ETH_USER_PK")
},
etherscan_api_key: System.fetch_env!("ETH_API_KEY"),
contract: %Contract{address: System.fetch_env!("ETH_CONTRACT"), functions: nil}
contract: %Contract{address: System.get_env("ETH_CONTRACT"), functions: nil}
}
end
end