diff --git a/.ci-config.json b/.ci-config.json new file mode 100644 index 0000000..0e28add --- /dev/null +++ b/.ci-config.json @@ -0,0 +1,4 @@ +{ + "python_version_current": "3.12", + "python_versions_active": ["3.8", "3.9", "3.10", "3.11", "3.12"] +} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 079730d..32d3181 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,14 +2,29 @@ name: OctoDNS on: [pull_request] jobs: + config: + runs-on: ubuntu-latest + outputs: + json: ${{ steps.load.outputs.json }} + steps: + - uses: actions/checkout@v4 + - id: load + # based on https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings + run: | + { + echo 'json<> $GITHUB_OUTPUT ci: + needs: config runs-on: ubuntu-latest strategy: fail-fast: false matrix: - # Defined in an org level variable, based on dates in - # https://devguide.python.org/versions/#versions - python-version: ${{fromJson(vars.PYTHON_VERSIONS_ACTIVE)}} + # Defined in a file that resides in the top level of octodns/octodns, + # based on dates in https://devguide.python.org/versions/#versions + python-version: ${{ fromJson(needs.config.outputs.json).python_versions_active }} steps: - uses: actions/checkout@v4 - name: Setup python @@ -36,13 +51,15 @@ jobs: coverage.xml htmlcov setup-py: + needs: config runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup python uses: actions/setup-python@v4 with: - python-version: ${{ vars.PYTHON_VERSION_CURRENT }} + # Most recent release from https://devguide.python.org/versions/#versions + python-version: ${{ fromJson(needs.config.outputs.json).python_version_current }} architecture: x64 - name: CI setup.py run: | diff --git a/.github/workflows/modules.yml b/.github/workflows/modules.yml index 940abc1..15e1c3e 100644 --- a/.github/workflows/modules.yml +++ b/.github/workflows/modules.yml @@ -5,7 +5,22 @@ on: types: [submitted] jobs: + config: + runs-on: ubuntu-latest + outputs: + json: ${{ steps.load.outputs.json }} + steps: + - uses: actions/checkout@v4 + - id: load + # based on https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings + run: | + { + echo 'json<> $GITHUB_OUTPUT ci: + needs: config runs-on: ubuntu-latest strategy: fail-fast: false @@ -46,8 +61,8 @@ jobs: - name: Setup python uses: actions/setup-python@v4 with: - python-version: ${{ vars.PYTHON_VERSION_CURRENT }} + python-version: ${{ fromJson(needs.config.outputs.json).python_version_current }} architecture: x64 - name: Test Module run: | - ./script/test-module ${{ matrix.module }} + ./script/cibuild-module ${{ matrix.module }} diff --git a/requirements-dev.txt b/requirements-dev.txt index c0c68ce..e4bfab5 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -40,6 +40,8 @@ requests-toolbelt==1.0.0 requests==2.31.0 rfc3986==2.0.0 rich==13.6.0 +setuptools==68.2.2 twine==4.0.2 urllib3==2.0.6 +wheel==0.41.2 zipp==3.17.0 diff --git a/script/test-module b/script/cibuild-module similarity index 98% rename from script/test-module rename to script/cibuild-module index 8148d73..b48ba7c 100755 --- a/script/test-module +++ b/script/cibuild-module @@ -15,6 +15,7 @@ VENV_PYTHON=$(command -v python3) VENV_NAME="${TMP_DIR}/env" "$VENV_PYTHON" -m venv "$VENV_NAME" . "${VENV_NAME}/bin/activate" +pip install setuptools echo "## environment & versions ######################################################" python --version pip --version diff --git a/script/cibuild-setup-py b/script/cibuild-setup-py index 49f8409..31d1d32 100755 --- a/script/cibuild-setup-py +++ b/script/cibuild-setup-py @@ -7,6 +7,7 @@ echo "## create test venv ###################################################### TMP_DIR=$(mktemp -d -t ci-XXXXXXXXXX) python3 -m venv $TMP_DIR . "$TMP_DIR/bin/activate" +pip install setuptools echo "## environment & versions ######################################################" python --version pip --version