Bump black from 23.3.0 to 24.3.0 in /server/python #33
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: Python Server Build | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- server/python/** | |
pull_request: | |
branches: | |
- main | |
paths: | |
- server/python/** | |
jobs: | |
code_analysis: | |
defaults: | |
run: | |
working-directory: server/python | |
name: Code Analysis | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
strategy: | |
fail-fast: false | |
matrix: | |
language: ["python"] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-test.txt | |
- name: Lint | |
run: | | |
pylint *.py | |
black --check . | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v1 | |
with: | |
languages: ${{ matrix.language }} | |
- name: Autobuild | |
uses: github/codeql-action/autobuild@v1 | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v1 | |
lint-and-test: | |
defaults: | |
run: | |
working-directory: server/python | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-test.txt | |
- name: Lint | |
run: | | |
pylint *.py | |
black --check . | |
- name: Test | |
run: | | |
pytest tests | |
build: | |
if: github.event_name == 'push' | |
needs: lint-and-test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
pull-requests: write | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ghcr.io/pradyumnakrishna/enigma-protocol/python-server | |
steps: | |
- name: Set DATE | |
run: echo "DATE=$(date '+%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push Server Image | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: server/python | |
push: true | |
tags: ${{ env.IMAGE_NAME }}:latest,${{ env.IMAGE_NAME }}:${{ env.DATE }} |