Skip to content

Update python-app.yml #13

Update python-app.yml

Update python-app.yml #13

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run
run: |
./generate_plots
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v2.0.0
with:
# Artifact name
name: github-pages
# Path of the directory containing the static assets.
path: _site/
# Duration after which artifact will expire in days.
retention-days: 1
- name: Deploy GitHub Pages site
uses: actions/deploy-pages@v1.2.9
with:
# Should this action only emit build telemetry instead of deploying the build artifact?
emit_telemetry: false
# The status of the previous build.
# conclusion: # optional
# GitHub token
token: ${{ github.token }}
# Time in milliseconds after which to timeout and cancel the deployment (default: 10 minutes)
timeout: 600000
# Maximum number of status report errors before cancelling a deployment (default: 10)
# error_count: # optional, default is 10
# Time in milliseconds between two deployment status report (default: 5 seconds)
# reporting_interval: # optional, default is 5000
# Name of the artifact to deploy
artifact_name: github-pages # optional, default is github-pages
# Is this attempting to deploy a pull request as a GitHub Pages preview site? (NOTE: This feature is only in alpha currently and is not available to the public!)
# preview: # optional, default is false