Bot and API to containers #140
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint-test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
directory: ['api', 'xythrion'] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
cache-dependency-path: "${{ matrix.directory }}/pyproject.toml" | |
- name: Set up PDM | |
uses: pdm-project/setup-pdm@v2 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
working-directory: ${{ matrix.directory }} | |
run: pdm sync | |
- name: Run lints | |
working-directory: ${{ matrix.directory }} | |
run: pdm lint | |
- name: Run tests | |
working-directory: ${{ matrix.directory }} | |
# Matplotlib tests are currently broken, skipping for now. | |
if: ${{ matrix.directory }} != 'api' | |
run: pdm test | |
- name: Prepare Pull Request Payload artifact | |
working-directory: ${{ matrix.directory }} | |
id: prepare-artifact | |
if: always() && github.event_name == 'pull_request' | |
continue-on-error: true | |
run: cat $GITHUB_EVENT_PATH | jq '.pull_request' > pull_request_payload.json | |
- name: Upload a Build Artifact | |
if: always() && steps.prepare-artifact.outcome == 'success' | |
continue-on-error: true | |
uses: actions/upload-artifact@v3 | |
with: | |
working-directory: ${{ matrix.directory }} | |
name: pull-request-payload | |
path: pull_request_payload.json |