Bump virtualenv from 20.21.0 to 20.24.0 #538
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: Lint, test and notify | |
on: [push] | |
# env: | |
# PYTHONPATH: ${{ github.workspace }}:${{ github.workspace }}/nlp4all:$PYTHONPATH | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
id: cpmat | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
echo "PYTHONPATH=${{ github.workspace }}" >> $GITHUB_ENV | |
python -m pip install --progress-bar off --upgrade pip | |
pip install --progress-bar off wheel | |
pip install --progress-bar off -r requirements-dev.txt | |
- name: Print python os env for debugging, and pip freeze | |
run: | | |
printenv | |
pip freeze | |
- name: Analysing the code with Flake8 | |
run: | | |
flake8 | |
# figure out why mypy doesn't work on github later | |
- name: Type checking with mypy | |
run: | | |
mypy | |
- name: Run tests with pytest | |
run: | | |
pytest | |
failure_notification: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: Sniddl/discord-commits@v1.6 | |
if: ${{ !env.ACT }} | |
with: | |
webhook: ${{ secrets.DISCORD_WEBHOOK_STATUS }} # required | |
message: ":x: Build failed for **{{ github.context.payload.repository.owner.name }}/{{ github.context.payload.repository.name}}**. Run output: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\nDiff: {{ github.context.payload.compare }}" | |
embed: '{ "title": "{{ commit.title }}", "description": "{{ commit.description }}", "url": "{{ commit.url }}", "author": { "name": "{{ commit.author.name }} ({{ commit.author.username }})", "icon_url": "https://avatars.io/gravatar/{{ commit.author.email }}"} }' | |
if: failure() | |
success_notification: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: Sniddl/discord-commits@v1.6 | |
if: ${{ !env.ACT }} | |
with: | |
webhook: ${{ secrets.DISCORD_WEBHOOK_STATUS }} # required | |
message: ":white_check_mark: Build succeeded for **{{ github.context.payload.repository.owner.name }}/{{ github.context.payload.repository.name}}**. Run output: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\nDiff: {{ github.context.payload.compare }}" | |
embed: '{ "title": "{{ commit.title }}", "description": "{{ commit.description }}", "url": "{{ commit.url }}", "author": { "name": "{{ commit.author.name }} ({{ commit.author.username }})", "icon_url": "https://avatars.io/gravatar/{{ commit.author.email }}"} }' | |
if: success() |