MNTSUP-171 - add python checks to GHA #27
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
# This workflow will build a Java project with Gradle | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: CI | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip mypy | |
pip install -r src/main/docker/docker_root/requirements.txt | |
- name: Check static typing | |
run: mypy src/main/docker/docker_root/swarmclean.py | |
- name: Check formatting | |
run: | | |
pip install ruff | |
ruff format --diff src/main/docker/docker_root/swarmclean.py | |
# - name: Run tests | |
# run: | | |
# pip install -r src/test/requirements.txt | |
# pytest --cov --cov-report=xml | |
# - name: SonarCloud Scan | |
# uses: SonarSource/sonarcloud-github-action@master | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: 11 | |
distribution: temurin | |
- name: Login to Docker | |
uses: docker/login-action@v3 | |
with: | |
registry: open-source.docker.xenit.eu | |
username: ${{ secrets.CLOUDSMITH_USER }} | |
password: ${{ secrets.CLOUDSMITH_APIKEY }} | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: Build docker image | |
run: ./gradlew buildDockerImage | |
- name: Publish docker image | |
if: ${{ startsWith(github.ref, 'refs/heads/master') }} | |
run: ./gradlew pushDockerImage |