diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/docs.yaml | 19 | ||||
-rw-r--r-- | .github/workflows/lint-test.yaml | 22 | ||||
-rw-r--r-- | .github/workflows/main.yaml | 17 |
3 files changed, 34 insertions, 24 deletions
diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 372a2b8f..03e6bc96 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,15 +1,8 @@ name: Build Docs on: - push: - branches: - - main - pull_request: workflow_dispatch: - -concurrency: - group: docs-deployment-${{ github.ref }} - cancel-in-progress: true + workflow_call: jobs: latest-build: @@ -21,11 +14,11 @@ jobs: - uses: actions/checkout@v2 - name: Install Python Dependencies - uses: HassanAbouelela/actions/setup-python@setup-python_v1.3.1 + uses: HassanAbouelela/actions/setup-python@setup-python_v1.3.2 with: dev: true - python_version: "3.10" - install_args: "--extras async-rediscache" + python_version: "3.11" + install_args: "--extras async-rediscache --only main --only doc" - name: Generate HTML Site run: sphinx-build -nW -j auto -b html docs docs/build @@ -46,10 +39,10 @@ jobs: fetch-depth: 0 # We need to check out the entire repository to find all tags - name: Install Python Dependencies - uses: HassanAbouelela/actions/setup-python@setup-python_v1.3.1 + uses: HassanAbouelela/actions/setup-python@setup-python_v1.3.2 with: dev: true - python_version: "3.10" + python_version: "3.11" install_args: "--extras async-rediscache" - name: Build All Doc Versions diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index dc83086b..5d8c1aff 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -1,27 +1,24 @@ name: Lint & Test on: - push: - branches: - - main - pull_request: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + workflow_call: jobs: lint: + strategy: + fail-fast: false + matrix: + python_version: ["3.10", "3.11"] name: Run Linting & Test Suites runs-on: ubuntu-latest steps: - name: Install Python Dependencies - uses: HassanAbouelela/actions/setup-python@setup-python_v1.3.1 + uses: HassanAbouelela/actions/setup-python@setup-python_v1.3.2 with: # Set dev=true to run pre-commit which is a dev dependency dev: true - python_version: "3.10" - install_args: "--extras async-rediscache" + python_version: ${{ matrix.python_version }} + install_args: "--extras async-rediscache --only main --only lint --only test" # We will not run `flake8` here, as we will use a separate flake8 # action. @@ -43,6 +40,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 --env GUILD_ID=1234 --env IN_CI=true $(docker build --build-arg python_version=${{ matrix.python_version }} -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/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 00000000..62be12e4 --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,17 @@ +name: main + +on: + push: + branches: + - main + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint-test: + uses: ./.github/workflows/lint-test.yaml + docs: + uses: ./.github/workflows/docs.yaml |