Skip to content

Commit

Permalink
implement ci build caching and fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
throwawayay authored Sep 18, 2021
1 parent 668eb2e commit 4db3168
Show file tree
Hide file tree
Showing 17 changed files with 371 additions and 615 deletions.
37 changes: 14 additions & 23 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,26 @@
# https://securitylab.github.com/tools/codeql/
name: "CodeQL"
# More information: https://securitylab.github.com/tools/codeql/

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
schedule:
- cron: '45 5 * * 0'
branches: [master]

jobs:
analyze:
name: Analyze
CodeQL-Build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: ['python']
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# https://docs.github.com/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
permissions:
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: python

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
45 changes: 27 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
workflow_dispatch:

jobs:
# This workflow contains a single job called "build"
build:
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -23,25 +22,31 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install OS dependencies
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Install Linux dependencies
if: startsWith(matrix.os, 'ubuntu')
env:
USECURL: 7.68.0-openssl11-gssapi-libssh2
USECURL: 7.79.0-openssl11-gssapi-libssh2
USESSL: openssl
USEOPENSSL: 1.1.1d
run: |
sudo apt update
sudo apt upgrade
sudo apt install libcurl4-openssl-dev libssl-dev libgnutls28-dev python3-dev
sudo apt-get install libcurl4-gnutls-dev libgnutls28-dev
shell: bash
- name: Install Qt
uses: jurplel/install-qt-action@v2
- name: Install Win dependencies
- name: Install Windows dependencies
if: startsWith(matrix.os, 'windows')
run: |
pip3 install tests/pycurl-7.44.1-cp39-cp39-win_amd64.whl
python -m pip install tests/pycurl-7.43.0.5-cp39-cp39-win_amd64.whl
shell: cmd
- name: Install Mac dependencies
- name: Install macOS dependencies
if: startsWith(matrix.os, 'macOS')
env:
LDFLAGS: "-L/usr/local/opt/openssl/lib"
Expand All @@ -51,21 +56,25 @@ jobs:
brew upgrade
brew uninstall --ignore-dependencies curl
brew install curl
pip install pycurl --compile --no-cache-dir
python -m pip install pycurl --compile --no-cache-dir
- name: Install python dependencies
run: |
pip install -r requirements.txt
pip install -r requirements_dev.txt
- name: Tests and coverage
python -m pip install --upgrade wheel
python -m pip install -r requirements.txt
python -m pip install -r requirements_dev.txt
- name: Execute tests and coverage report
env:
QT_QPA_PLATFORM: offscreen
run: |
invoke coverage --gui
- name: Lint
continue-on-error: true
# FIXME: replace with platform-agnostic method to check pylint exit code
if: matrix.os != 'windows-latest'
run: |
invoke lint
- name: Coveralls report
invoke lint || python tests/pylint_exit.py $?
- name: Upload code coverage report to Coveralls
# FIXME: remove once coveralls.io is back online
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand Down
Loading

0 comments on commit 4db3168

Please sign in to comment.