update if and add type hints (#603) #1406
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Sphinx Build Deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
SETUPTOOLS_ENABLE_FEATURES="legacy-editable" python -m pip install --editable . | |
- name: Verify Format | |
run: | | |
validate | |
- name: Unit Test Sample Code | |
run: | | |
python -m unittest | |
sphinx: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
SETUPTOOLS_ENABLE_FEATURES="legacy-editable" python -m pip install --editable . | |
- name: Sphinx Build | |
run: | | |
site | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: website | |
path: out/ | |
deploy: | |
needs: | |
- test | |
- sphinx | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.repository == 'jameshughes89/cs101' | |
concurrency: deploying | |
steps: | |
- name: Create Site Directory | |
run: mkdir out | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: website | |
path: out | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: Copy Files to the Website | |
run: | | |
aws s3 sync ./out s3://modsurski.com/csci161 --delete | |