diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index e008a9b8..00000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,74 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "main" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "main" ] - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Use only 'java' to analyze code written in Java, Kotlin or both - # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v2 - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml deleted file mode 100644 index fe461b42..00000000 --- a/.github/workflows/dependency-review.yml +++ /dev/null @@ -1,20 +0,0 @@ -# Dependency Review Action -# -# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. -# -# Source repository: https://github.com/actions/dependency-review-action -# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement -name: 'Dependency Review' -on: [pull_request] - -permissions: - contents: read - -jobs: - dependency-review: - runs-on: ubuntu-latest - steps: - - name: 'Checkout Repository' - uses: actions/checkout@v3 - - name: 'Dependency Review' - uses: actions/dependency-review-action@v2 diff --git a/.github/workflows/lint-flake8.yml b/.github/workflows/lint-flake8.yml deleted file mode 100644 index 75d098a5..00000000 --- a/.github/workflows/lint-flake8.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Lint with flake8 - -on: - push: - branches: - - main - - 'releases/**' - pull_request: - -jobs: - lint-flake8: - - runs-on: ubuntu-latest - strategy: - fail-fast: false - - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.x - uses: actions/setup-python@v3 - with: - python-version: '3.x' - - - name: Display Python version - run: python -c "import sys; print(sys.version)" - - - name: Install flake8 - run: | - python -m pip install --upgrade pip - python -m pip install flake8 - - - 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 diff --git a/.github/workflows/simple-program-linux.yml b/.github/workflows/simple-program-linux.yml index bdc941f6..91464dbb 100644 --- a/.github/workflows/simple-program-linux.yml +++ b/.github/workflows/simple-program-linux.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.11"] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/simple-program-macos.yml b/.github/workflows/simple-program-macos.yml deleted file mode 100644 index b12a1c18..00000000 --- a/.github/workflows/simple-program-macos.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: Simple program (MacOS) - -on: - push: - branches: - - main - - 'releases/**' - pull_request: - -jobs: - simple-program: - - runs-on: macos-latest - - strategy: - fail-fast: false - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements.txt - - - name: Run simple-program.py during 20 seconds - run: | - # For tests there is no real HW: use simulated LCD mode - sed -i "" "s|^REVISION.*$|REVISION=\"SIMU\"|g" simple-program.py - - # Run the program for 20s - python3 simple-program.py > output.log 2>&1 & - sleep 20 - - - name: Check output for errors - run: | - echo "######## Output : ########" - cat output.log - - if grep -qi "error" output.log; then - echo "Program failed to run, see output above" - false - elif grep -qi "traceback" output.log; then - echo "Program failed to run, see output above" - false - elif grep -qi "exception" output.log; then - echo "Program failed to run, see output above" - false - fi - - - name: Prepare screenshot for archiving - run: | - cp screencap.png screenshot-py${{ matrix.python-version }}.png - - - name: Archive a screenshot - uses: actions/upload-artifact@v3 - with: - name: screenshot-py${{ matrix.python-version }} - path: screenshot-*.png \ No newline at end of file diff --git a/.github/workflows/simple-program-windows.yml b/.github/workflows/simple-program-windows.yml deleted file mode 100644 index d0054f22..00000000 --- a/.github/workflows/simple-program-windows.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Simple program (Windows) - -on: - push: - branches: - - main - - 'releases/**' - pull_request: - -jobs: - simple-program: - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements.txt - - - name: Run simple-program.py during 20 seconds - run: | - # For tests there is no real HW: use simulated LCD mode - (Get-Content simple-program.py) -replace "^REVISION.*$","REVISION=`"SIMU`"" | Set-Content simple-program.py - - # Run the program for 20s - Start-Process -NoNewWindow python3 simple-program.py -RedirectStandardOutput output.log -RedirectStandardError error.log - sleep 20 - add-content output.log (get-content error.log) - - - name: Check output for errors - run: | - echo "######## Output : ########" - cat output.log - - $SEL = Select-String -Path output.log -Pattern "error" - if ($SEL -ne $null) - { - throw "Program failed to run, see output above" - } - $SEL = Select-String -Path output.log -Pattern "traceback" - if ($SEL -ne $null) - { - throw "Program failed to run, see output above" - } - $SEL = Select-String -Path output.log -Pattern "exception" - if ($SEL -ne $null) - { - throw "Program failed to run, see output above" - } - - - name: Prepare screenshot for archiving - run: | - cp screencap.png screenshot-py${{ matrix.python-version }}.png - - - name: Archive a screenshot - uses: actions/upload-artifact@v3 - with: - name: screenshot-py${{ matrix.python-version }} - path: screenshot-*.png diff --git a/.github/workflows/system-monitor-linux.yml b/.github/workflows/system-monitor-linux.yml deleted file mode 100644 index 12e1e576..00000000 --- a/.github/workflows/system-monitor-linux.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: System monitor (Linux) - -on: - push: - branches: - - main - - 'releases/**' - pull_request: - -jobs: - system-monitor: - - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - theme: [ "3.5inchTheme2", "Cyberpunk", "Landscape6Grid", "Terminal", "bash-dark-green", "bash-dark-green-gpu", - "LandscapeMagicBlue", "BigClock" ] - - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install Cython # Because of a bug with Python 3.11, Cython must be installed first manually - python -m pip install -r requirements.txt - - - name: Configure system monitor - run: | - # For tests there is no real HW: use simulated LCD mode - sed -i "/REVISION:/c\ REVISION: SIMU" config.yaml - - # Setup selected theme in config.yaml - echo "Using theme ${{ matrix.theme }}" - sed -i "/THEME:/c\ THEME: ${{ matrix.theme }}" config.yaml - - - name: Run system monitor for 20 seconds - run: | - python3 main.py > output.log 2>&1 & - sleep 20 - - - name: Check output for errors - run: | - echo "######## Output : ########" - cat output.log - - if grep -qi "error" output.log; then - echo "Program failed to run, see output above" - false - elif grep -qi "traceback" output.log; then - echo "Program failed to run, see output above" - false - elif grep -qi "exception" output.log; then - echo "Program failed to run, see output above" - false - fi - - - name: Prepare screenshot for archiving - run: | - cp screencap.png screenshot-py${{ matrix.python-version }}-${{ matrix.theme }}.png - - - name: Archive a screenshot - uses: actions/upload-artifact@v3 - with: - name: screenshot-py${{ matrix.python-version }}-${{ matrix.theme }} - path: screenshot-*.png \ No newline at end of file diff --git a/.github/workflows/system-monitor-macos.yml b/.github/workflows/system-monitor-macos.yml deleted file mode 100644 index 8f32753e..00000000 --- a/.github/workflows/system-monitor-macos.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: System monitor (MacOS) - -on: - push: - branches: - - main - - 'releases/**' - pull_request: - -jobs: - system-monitor: - - runs-on: macos-latest - - strategy: - fail-fast: false - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - theme: [ "3.5inchTheme2", "Cyberpunk", "Landscape6Grid", "Terminal", "bash-dark-green", "bash-dark-green-gpu", - "LandscapeMagicBlue", "BigClock" ] - - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements.txt - - - name: Configure system monitor - run: | - # For tests there is no real HW: use simulated LCD mode - sed -i "" "s|^ REVISION.*$| REVISION: SIMU|g" config.yaml - - # Setup selected theme in config.yaml - echo "Using theme ${{ matrix.theme }}" - sed -i "" "s|^ THEME.*$| THEME: ${{ matrix.theme }}|g" config.yaml - - - name: Run system monitor for 20 seconds - run: | - python3 main.py > output.log 2>&1 & - sleep 20 - - - name: Check output for errors - run: | - echo "######## Output : ########" - cat output.log - - if grep -qi "error" output.log; then - echo "Program failed to run, see output above" - false - elif grep -qi "traceback" output.log; then - echo "Program failed to run, see output above" - false - elif grep -qi "exception" output.log; then - echo "Program failed to run, see output above" - false - fi - - - name: Prepare screenshot for archiving - run: | - cp screencap.png screenshot-py${{ matrix.python-version }}-${{ matrix.theme }}.png - - - name: Archive a screenshot - uses: actions/upload-artifact@v3 - with: - name: screenshot-py${{ matrix.python-version }}-${{ matrix.theme }} - path: screenshot-*.png \ No newline at end of file diff --git a/.github/workflows/system-monitor-windows.yml b/.github/workflows/system-monitor-windows.yml deleted file mode 100644 index 30088467..00000000 --- a/.github/workflows/system-monitor-windows.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: System monitor (Windows) - -on: - push: - branches: - - main - - 'releases/**' - pull_request: - -jobs: - system-monitor: - - runs-on: windows-latest - - strategy: - fail-fast: false - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - theme: [ "3.5inchTheme2", "Cyberpunk", "Landscape6Grid", "Terminal", "bash-dark-green", "bash-dark-green-gpu", - "LandscapeMagicBlue", "BigClock" ] - - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install -r requirements.txt - - - name: Configure system monitor - run: | - # For tests there is no real HW: use simulated LCD mode - (Get-Content config.yaml) -replace "^ REVISION.*$"," REVISION: SIMU" | Set-Content config.yaml - - # Setup selected theme in config.yaml - echo "Using theme ${{ matrix.theme }}" - (Get-Content config.yaml) -replace "^ THEME.*$"," THEME: ${{ matrix.theme }}" | Set-Content config.yaml - - # For tests do not use LibreHardwareMonitor as it needs admin rights - (Get-Content config.yaml) -replace "^ HW_SENSORS.*$"," HW_SENSORS: PYTHON" | Set-Content config.yaml - - - name: Run system monitor for 20 seconds - run: | - Start-Process -NoNewWindow python3 main.py -RedirectStandardOutput output.log -RedirectStandardError error.log - sleep 20 - add-content output.log (get-content error.log) - - - name: Check output for errors - run: | - echo "######## Output : ########" - cat output.log - - $SEL = Select-String -Path output.log -Pattern "error" - if ($SEL -ne $null) - { - throw "Program failed to run, see output above" - } - $SEL = Select-String -Path output.log -Pattern "traceback" - if ($SEL -ne $null) - { - throw "Program failed to run, see output above" - } - $SEL = Select-String -Path output.log -Pattern "exception" - if ($SEL -ne $null) - { - throw "Program failed to run, see output above" - } - - - name: Prepare screenshot for archiving - run: | - cp screencap.png screenshot-py${{ matrix.python-version }}-${{ matrix.theme }}.png - - - name: Archive a screenshot - uses: actions/upload-artifact@v3 - with: - name: screenshot-py${{ matrix.python-version }}-${{ matrix.theme }} - path: screenshot-*.png