Skip to content

Brownie project template preconfigured for use with Github Actions

License

Notifications You must be signed in to change notification settings

brownie-mix/github-actions-mix

Repository files navigation

github-actions-mix

This is a Brownie project template preconfigured for:

Please read this entire document carefully to ensure the proper setup of each component.

Feel free to join us in the Brownie Gitter channel, or open an issue if you encounter a problem with this template.

Installation

Downloading the Template

  1. Install Brownie, if you haven't already.

  2. Use the bake command to initialize a new project from this template:

    brownie bake github-actions

Creating a Virtual Environment

It is strongly recommended use a virtual environment with this project. This ensures that dependencies are strictly contained within your project and will not alter or affect your other development environment.

To create a new virtual environment and install the required dependencie:

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

In future sessions, activate the virtual environment with:

source venv/bin/activate

To learn more about venv, see the official Python documentation.

Configuring Pre-commit

Pre-commit is a tool that executes linting checks each time you make a commit. It is useful for enforcing proper codestyle and preventing commits that would fail the linting build.

To install pre-commit locally:

pre-commit install

Once installed, the pre-commit hooks will automatically run each time you make a commit.

Configuring Github Actions

Github Actions is a hosted continuous integration service provided by Github. It runs your project tests each time you push a new commit or open a pull request, providing quick feedback on the outcome of each change.

Github Actions is provided free for public repositories. It is automatically enabled - if you create your own project with this mix as a base it will be active whenever you push a commit.

Depending on the requirements of your project, you may need to set the following environment variables:

  • ETHERSCAN_TOKEN: Etherscan API token, required if you are querying source files from Etherscan.
  • GITHUB_TOKEN: Github personal access token, required by py-solc-x when querying installable solc versions.
  • WEB3_INFURA_PROJECT_ID: Infura project ID, required for connecting to Infura hosted nodes.

See the official Github Actions documentation for information on how to set environment variables.

Running the Tests

This project uses tox to standardize the local and remote testing environments.

To run all of your project's unit tests and perform linting checks:

tox

To run only the linting checks:

tox -e lint

License

This project is licensed under the MIT license.

About

Brownie project template preconfigured for use with Github Actions

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published