Skip to content

main

main #2829

Workflow file for this run

name: main
on:
push:
branches: [main]
tags: ['*']
schedule:
- cron: "0 09 * * *" # Runs 11 AM UTC == 2 AM PDT
pull_request:
branches: [main]
workflow_dispatch:
permissions:
id-token: write
contents: write
pull-requests: write
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
include:
- os: macos-latest
python-version: '3.9'
- os: windows-latest
python-version: '3.9'
runs-on: ${{ matrix.os }}
name: test (py${{ matrix.python-version }} ${{ matrix.os }})
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip install '.[test]'
- run: pip freeze
- run: make lint
- run: rsconnect version
- run: make test-${{ matrix.python-version }}
- if: github.event_name == 'pull_request' && matrix.python-version == '3.8'
uses: orgoro/coverage@v3
with:
coverageFile: coverage.xml
token: ${{ secrets.GITHUB_TOKEN }}
prerelease-test:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: 3.8.x
- run: pip install --pre '.[test]'
- run: pip freeze
- run: make lint
- run: rsconnect version
- run: make test-3.8
distributions:
needs: test
strategy:
matrix:
package_name: ["rsconnect_python", "rsconnect"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v4
with:
python-version: 3.8.x
- name: Install uv # see scripts/temporary-rename
uses: astral-sh/setup-uv@v6
- run: pip install -e '.[test]'
- run: pip freeze
- run: make dist
id: create_dist
env:
PACKAGE_NAME: ${{ matrix.package_name }}
- run: pip install -vvv ${{ steps.create_dist.outputs.whl }}
- run: rsconnect version
- run: rsconnect --help
- name: create github release
uses: softprops/action-gh-release@v2
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && matrix.package_name == 'rsconnect_python'
with:
files: |
dist/*.whl
token: ${{ secrets.GITHUB_TOKEN }}
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
docs:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: 3.12
- name: build docs
run: make docs
- uses: actions/upload-artifact@v4
with:
name: docs
path: site/
- uses: aws-actions/configure-aws-credentials@v4
id: creds
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
aws-region: ${{ secrets.AWS_REGION }}
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: make sync-latest-docs-to-s3
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.DOCS_AWS_ROLE }}
aws-region: us-east-1
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
run: make promote-docs-in-s3
test-rsconnect:
name: "Integration tests against latest Connect"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.12.4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r vetiver-testing/vetiver-requirements.txt
python -m pip install '.[test]'
- name: Run Posit Connect
run: |
docker compose up --build -d
pip freeze > requirements.txt
make dev
env:
RSC_LICENSE: ${{ secrets.RSC_LICENSE }}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Get logs in case of failure
run: |
docker compose logs rsconnect
if: ${{ failure() }}
# NOTE: edited to run checks for python package
- name: Run tests
run: |
pytest tests/test_main_system_caches.py
pytest -m 'vetiver'