Skip to content

CI

CI #179

Workflow file for this run

name: CI
on:
# We run CI on pushes to the main branch
push:
branches:
- main
# and on all pull requests to the main branch
pull_request:
branches:
- main
# as well as upon manual triggers through the 'Actions' tab of the Github UI
workflow_dispatch:
# Additionally, we run Monday morning 6AM, so that we can react quickly if things break
schedule:
- cron: "0 5 * * 1"
jobs:
test:
name: Testing on ${{ matrix.os }} with Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.11"]
steps:
- name: Checking out the cookie cutter repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install test requirements
run: |
python -m pip install -r requirements-dev.txt
- name: Set up git identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "SSC CI Test User"
- name: Set up Windows git configuration
if: runner.os == 'Windows'
run: |
git config --system core.longpaths true
- name: Run regular test suite
run: |
python -m pytest -m local
deploy-test:
name: Deploying to hosters and run their CI
runs-on: ubuntu-latest
steps:
- name: Checking out the cookie cutter repository
uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Install test requirements
run: |
python -m pip install -r requirements-dev.txt
- name: Set up git identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "SSC CI Test User"
- name: Set up SSH Agent to deploy to test repositories
uses: webfactory/[email protected]
with:
ssh-private-key: |
${{ secrets.GHA_TEST_PRIVATE_KEY }}
- name: Add gitlab.com to the list of known hosts
run: |
echo "gitlab.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsj2bNKTBSpIYDEGk9KxsGh3mySTRgMtXL583qmBpzeQ+jqCMRgBqB98u3z++J1sKlXHWfM9dyhSevkMwSbhoR8XIq/U0tCNyokEi/ueaBMCvbcTHhO7FcwzY92WK4Yt0aGROY5qX2UKSeOvuP4D6TPqKF1onrSzH9bx9XUf2lEdWT/ia1NEKjunUqu1xOB/StKDHMoX4/OKyIzuS0q/T1zOATthvasJFoPrAjkohTyaDUz2LN5JoH839hViyEG82yB+MjcFV5MU3N1l1QL3cVUCh93xSaua1N85qivl+siMkPGbO5xR/En4iEY6K2XPASUEMaieWVNTRCtJ4S8H+9" >> ~/.ssh/known_hosts
- name: Test deploying the baked project to Github + Gitlab.com
run: |
python -m pytest -m deploy
- name: Run tests for upstream integrations
env:
CODECOV_GH_API_ACCESS_TOKEN: ${{ secrets.CODECOV_GH_API_ACCESS_TOKEN }}
GH_API_ACCESS_TOKEN: ${{ secrets.GH_API_ACCESS_TOKEN }}
GL_API_ACCESS_TOKEN: ${{ secrets.GL_API_ACCESS_TOKEN }}
RTD_API_ACCESS_TOKEN: ${{ secrets.RTD_API_ACCESS_TOKEN }}
run: |
python -m pytest -m integrations