From 89498440aebfc04d407559897213419b228c6428 Mon Sep 17 00:00:00 2001 From: Adam Mcgrath Date: Tue, 5 Dec 2023 14:25:38 +0000 Subject: [PATCH] Fix py 3.12 build II --- .github/workflows/adamtest.yml | 62 ++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 17 ++++++++-- 2 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/adamtest.yml diff --git a/.github/workflows/adamtest.yml b/.github/workflows/adamtest.yml new file mode 100644 index 00000000..03965d73 --- /dev/null +++ b/.github/workflows/adamtest.yml @@ -0,0 +1,62 @@ +name: Adam Test + +on: + merge_group: + pull_request: + types: + - opened + - synchronize + push: + branches: + - py12-build-fix + +permissions: + contents: read + +jobs: + + run: + name: Run + runs-on: ubuntu-latest + + env: + BUBBLEWRAP_ARGUMENTS: | + --unshare-all \ + --clearenv \ + --ro-bind / / \ + --bind ${{ github.workspace }} ${{ github.workspace }} \ + --tmpfs $HOME \ + --tmpfs /tmp \ + --tmpfs /var \ + --dev /dev \ + --proc /proc \ + --die-with-parent \ + --new-session \ + + strategy: + matrix: + python-version: ["3.12"] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Configure Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: "${{ matrix.python-version }}" + + - name: Configure dependencies + run: | + pip install --user --upgrade pip + pip install --user pipx + pip install --user setuptools + pipx ensurepath + pipx install poetry==1.4.2 + poetry config virtualenvs.in-project true + poetry install --with dev + poetry self add "poetry-dynamic-versioning[plugin]==1.1.1" + + - name: Run tests + run: | + poetry run pytest --cov=auth0 --cov-report=term-missing:skip-covered --cov-report=xml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9c5de110..63dd4aba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: Build and Test on: merge_group: - pull_request: + pull_request_target: types: - opened - synchronize @@ -18,6 +18,12 @@ concurrency: cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} jobs: + authorize: + name: Authorize + environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }} + runs-on: ubuntu-latest + steps: + - run: true run: needs: authorize # Require approval before running on forked pull requests @@ -41,11 +47,13 @@ jobs: strategy: matrix: - python-version: ["3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - name: Checkout code uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} - name: Configure Python ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -54,6 +62,7 @@ jobs: - name: Configure dependencies run: | + sudo apt install bubblewrap pip install --user --upgrade pip pip install --user pipx pip install --user setuptools @@ -77,3 +86,7 @@ jobs: # flake8 . --count --show-source --statistics # isort . --diff --profile black # pyupgrade . --py37-plus --keep-runtime-typing + + - if: ${{ matrix.python-version == '3.10' }} + name: Upload coverage + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # pin@3.1.4 \ No newline at end of file