Fixing CI jobs for fork #4
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 run unit tests | |
on: [push] | |
env: | |
ACE_REPO: "git+https://github.com/JHUAPL/dtnma-ace.git" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Prep | |
run: | | |
pip3 install ${ACE_REPO} | |
pip3 install build | |
- name: Build | |
run: python3 -m build | |
test: | |
needs: [build] | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Prep | |
run: | | |
pip3 install ${ACE_REPO} | |
pip3 install -e '.[test]' | |
- name: Test | |
run: python3 -m pytest -v --cov=camp tests | |
flake8: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Prep | |
run: | | |
pip3 install ${ACE_REPO} | |
pip3 install -e '.[flake8]' | |
- name: Run flake8 | |
run: | | |
FAIL_SRC=0 | |
flake8 src || FAIL_SRC=$? | |
release: | |
needs: [test, flake8] | |
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ["3.10"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Prep | |
run: pip3 install build | |
- name: Build | |
run: python3 -m build | |
- name: Upload package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |