scrape game remarks #320
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 Build | |
on: | |
push: | |
branches: ["*"] | |
workflow_dispatch: | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install Pipenv | |
run: python -m pip install --upgrade pipenv | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Cache Pipenv | |
id: cache-pipenv | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local/share/virtualenvs | |
key: pipenv-${{ hashFiles('Pipfile.lock') }} | |
- name: Install dependencies | |
if: steps.cache-pipenv.outputs.cache-hit != 'true' | |
run: pipenv install --deploy --dev | |
- name: Set up locale | |
run: | | |
sudo locale-gen de_DE.UTF-8 | |
sudo dpkg-reconfigure locales | |
- name: Run tests with coverage | |
run: pipenv run hbcoverage | |
env: | |
TEST_OUTPUT_FILE_NAME: unit.xml | |
- name: Generate coverage report | |
run: pipenv run coverage xml | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage report | |
path: coverage.xml | |
- name: Unit Test Report | |
uses: dorny/test-reporter@v1 | |
if: success() || failure() | |
with: | |
name: Unit Tests | |
path: unit.xml | |
reporter: java-junit | |
- name: Check format | |
run: pipenv run black src --check | |
- name: Check import order | |
run: pipenv run isort src --check | |
- name: Run Mypy | |
run: pipenv run mypy src | |
- name: Run Flake8 | |
run: pipenv run flake8 | |
- name: Run Pylint | |
run: pipenv run pylint src | |
coveralls: | |
runs-on: ubuntu-latest | |
needs: main | |
steps: | |
- name: Download coverage report | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage report | |
- uses: coverallsapp/github-action@v2 | |
codacy: | |
runs-on: ubuntu-latest | |
needs: main | |
steps: | |
- name: Download coverage report | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage report | |
- uses: codacy/codacy-coverage-reporter-action@v1 | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: coverage.xml | |
codeclimate: | |
runs-on: ubuntu-latest | |
needs: main | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Download coverage report | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage report | |
- uses: paambaati/codeclimate-action@v9 | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
codecov: | |
runs-on: ubuntu-latest | |
needs: main | |
steps: | |
- name: Download coverage report | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage report | |
- uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
licenses: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: "Run FOSSA Scan" | |
uses: fossas/fossa-action@v1.3.3 # see https://github.com/fossas/fossa-action/issues/39 | |
with: | |
api-key: ${{secrets.FOSSA_API_KEY}} | |
- name: "Run FOSSA Test" | |
uses: fossas/fossa-action@v1.3.3 # see https://github.com/fossas/fossa-action/issues/39 | |
with: | |
api-key: ${{secrets.FOSSA_API_KEY}} | |
run-tests: true | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/.buildx-cache | |
key: buildx-${{ github.sha }} | |
restore-keys: | | |
buildx- | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v5 | |
with: | |
push: true | |
tags: djbrown/hbscorez:latest | |
builder: ${{ steps.buildx.outputs.name }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |