Skip to content

Commit

Permalink
Merge pull request #97 from palewire/conda-tests
Browse files Browse the repository at this point in the history
Add conda tests
  • Loading branch information
palewire authored Jan 4, 2024
2 parents 64fc539 + 9035961 commit 6a9e86a
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 10 deletions.
49 changes: 44 additions & 5 deletions .github/workflows/continuous-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: Testing and deployment
name: Continuous deployment

on:
push:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint-python:
name: Lint Python code
Expand Down Expand Up @@ -33,7 +38,7 @@ jobs:
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
name: Test
name: "Test: pip"
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -50,21 +55,55 @@ jobs:
run: pip install requests click python-dateutil pandas

- id: download-data
name: Download download
name: Download data
run: python cpi/download.py

- id: tests
name: Run tests
run: python tests.py

- id: update
name: Test update
name: Update data
run: python cpi/download.py

test-conda:
strategy:
matrix:
python: ['3.9', '3.10', '3.11']
name: "Test: conda"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- id: install-python
name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- id: install-python-dependencies
name: Install Python dependencies
run: |
$CONDA/bin/conda create -n cpi python=${{ matrix.python }}
$CONDA/bin/conda install -n cpi requests click python-dateutil pandas
- id: download-data
name: Download data
run: $CONDA/bin/conda run -n cpi python cpi/download.py

- id: tests
name: Run tests
run: $CONDA/bin/conda run -n cpi python tests.py

- id: update
name: Update data
run: $CONDA/bin/conda run -n cpi python cpi/download.py

test-build:
name: Build Python package
runs-on: ubuntu-latest
needs: [test-python]
needs: [test-python, test-conda]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
33 changes: 28 additions & 5 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: "Build documentation"
name: Documentation

on:
push:
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
docs:
name: "Build and deploy"
build:
name: Build
runs-on: ubuntu-latest
steps:
- id: checkout
Expand Down Expand Up @@ -36,6 +40,25 @@ jobs:
shell: bash
working-directory: docs

- id: upload-release-candidate
name: Upload release candidate
uses: actions/upload-artifact@v4
with:
name: release-candidate
path: ./docs/_build/html/

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref_name == 'main' }}
steps:
- name: Download release candidate
uses: actions/download-artifact@v3
with:
name: release-candidate
path: ./docs/

- id: configure-aws
name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -50,7 +73,7 @@ jobs:
with:
bucket: ${{ secrets.PALEWIRE_DOCS_AWS_BUCKET }}
base-path: cpi/
dir: docs/_build/html/
dir: ./docs/
should-cache: false
use-accelerate-endpoint: false
public: true

0 comments on commit 6a9e86a

Please sign in to comment.