From 4c1997790a2b0ee295bfe6909570f888ad82db8c Mon Sep 17 00:00:00 2001 From: Chris Lovering Date: Wed, 26 Oct 2022 15:22:36 +0100 Subject: Add a dry run step to lint & test CI --- .github/workflows/lint-test.yaml | 3 +++ dev/bot/__main__.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index 222deb24..52a3e57a 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -43,6 +43,9 @@ jobs: - name: Run tests and generate coverage report run: python -m pytest -n auto --cov pydis_core -q + - name: Build and dry run the example bot to ensure deps can be installed & imported + run: docker run --rm -it --env GUILD_ID=1234 --env IN_CI=true $(docker build -q -f .\dev\Dockerfile .) run python -m dev.bot + # Prepare the Pull Request Payload artifact. If this fails, we # we fail silently using the `continue-on-error` option. It's # nice if this succeeds, but if it fails for any reason, it diff --git a/dev/bot/__main__.py b/dev/bot/__main__.py index 1b1a551a..e28be36b 100644 --- a/dev/bot/__main__.py +++ b/dev/bot/__main__.py @@ -31,4 +31,5 @@ async def main() -> None: async with bot: await bot.start(os.getenv("BOT_TOKEN")) -asyncio.run(main()) +if os.getenv("IN_CI", "").lower() != "true": + asyncio.run(main()) -- cgit v1.2.3