devops: Add Make file
#110
Workflow file for this run
This file contains hidden or 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: Static Code Checks | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| release: | |
| types: [ created ] | |
| jobs: | |
| format: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ 3.9, '3.10', 3.11, 3.12, 3.13 ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
| - name: Format | |
| run: | | |
| make format | |
| lint: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ 3.9, '3.10', 3.11, 3.12, 3.13 ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
| - name: Lint | |
| run: | | |
| make lint | |
| check: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ 3.9, '3.10', 3.11, 3.12, 3.13 ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
| - name: Check | |
| run: | | |
| make check | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ 3.9, '3.10', 3.11, 3.12, 3.13 ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
| - name: Test | |
| env: | |
| TEST_CLIENT_ID: ${{ secrets.TEST_CLIENT_ID }} | |
| TEST_CLIENT_SECRET: ${{ secrets.TEST_CLIENT_SECRET }} | |
| run: | | |
| make test | |
| docs: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ 3.9, '3.10', 3.11, 3.12, 3.13 ] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
| # TODO: improve documentation | |
| # - name: Docs style | |
| # run: | | |
| # make docs | |
| may-merge: | |
| if: always() | |
| needs: [ 'lint', 'check', 'test', 'docs' ] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: [ 3.9, '3.10', 3.11, 3.12, 3.13 ] | |
| steps: | |
| - name: Cleared for merging | |
| run: | | |
| if [ "${{ needs.lint.result }}" == "success" ] && [ "${{ needs.check.result }}" == "success" ] && [ "${{ needs.test.result }}" == "success" ] && [ "${{ needs.docs.result }}" == "success" ]; then | |
| echo "This PR is cleared for merging" | |
| else | |
| echo "This PR is not cleared for merging" | |
| exit 1 | |
| fi |