build docs workflow to pages #6
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: Build and Test (Flit) | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
build-and-test-flit: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
# Step 2: Set up Python | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
# Step 3: Install Flit, pytest, pytest-cov, and Coverage | |
- name: Install Flit, pytest, pytest-cov, and Coverage | |
run: | | |
pip install flit pytest pytest-cov coverage | |
# Step 4: Install dependencies (including dev dependencies) | |
- name: Install dependencies | |
run: | | |
export FLIT_ROOT_INSTALL=1 | |
flit install --deps=develop --extras=dev # Install dev dependencies | |
# Step 5: Run tests with coverage | |
- name: Run tests | |
run: | | |
coverage run --source=gds_fdtd -m pytest | |
coverage report | |
# Step 6: Upload coverage reports to Codecov | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |