From f48ee8bebd1ea6a5d8b474febbcfbb6c66e14c87 Mon Sep 17 00:00:00 2001 From: Jay Qi Date: Tue, 19 Mar 2024 10:45:57 -0400 Subject: [PATCH] Update all CI --- .github/workflows/docs-main.yml | 30 ++++++++++-------------------- .github/workflows/release.yml | 29 +++++++++++------------------ .github/workflows/tests.yml | 10 +++++----- 3 files changed, 26 insertions(+), 43 deletions(-) diff --git a/.github/workflows/docs-main.yml b/.github/workflows/docs-main.yml index 932a27cb..a8753e5e 100644 --- a/.github/workflows/docs-main.yml +++ b/.github/workflows/docs-main.yml @@ -11,31 +11,21 @@ jobs: runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 + - uses: conda-incubator/setup-miniconda@v3 with: - python-version: "3.10" - cache: "pip" - cache-dependency-path: | - pyproject.toml - requirements-dev.txt + miniforge-version: latest + activate-environment: "" + use-mamba: true - - name: Setup Graphviz - uses: ts-graphviz/setup-graphviz@v1 - with: - macos-skip-brew-update: 'true' - - - name: Install dependencies + - name: Install nox run: | - python -m pip install --upgrade pip - pip install -r requirements-dev.txt - pip install -e . + pipx install nox - - name: Build docs + - name: Build documentation run: | - make docs + nox -s docs --verbose - name: Stage docs on gh-pages working-directory: docs @@ -51,7 +41,7 @@ jobs: runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: gh-pages diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5d324ac..f24387e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,41 +13,34 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v4 + - uses: conda-incubator/setup-miniconda@v3 with: - python-version: "3.10" - cache: "pip" - cache-dependency-path: | - pyproject.toml - requirements-dev.txt + miniforge-version: latest + activate-environment: "" + use-mamba: true - - name: Setup Graphviz - uses: ts-graphviz/setup-graphviz@v1 - with: - macos-skip-brew-update: 'true' - - - name: Install dependencies + - name: Install nox and uv run: | - python -m pip install --upgrade pip - pip install -r requirements-dev.txt + pipx install nox + pipx install uv - name: Check that versions match id: version run: | + nox -s dev echo "Release tag: [${{ github.event.release.tag_name }}]" - PACKAGE_VERSION=$(python -c "import erdantic; print(erdantic.__version__)") + PACKAGE_VERSION=$(.nox/dev/bin/python -c "import erdantic; print(erdantic.__version__)") echo "Package version: [$PACKAGE_VERSION]" [ ${{ github.event.release.tag_name }} == "v$PACKAGE_VERSION" ] || { exit 1; } echo "::set-output name=major_minor_version::v${PACKAGE_VERSION%.*}" - name: Build package run: | - make dist + nox -s build - name: Build docs run: | - make docs + nox -s docs - name: Publish to Test PyPI uses: pypa/gh-action-pypi-publish@v1.3.0 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ba547db3..14807700 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,15 +85,15 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v4 + - uses: conda-incubator/setup-miniconda@v3 with: - python-version: "3.11" + miniforge-version: latest + activate-environment: "" + use-mamba: true - - name: Install nox and uv + - name: Install nox run: | pipx install nox - pipx install uv - name: Test building documentation run: |