Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into 185-change-the-directory-of-the-c…
Browse files Browse the repository at this point in the history
…onfigini-file-to-the-root
  • Loading branch information
kozaka-tv committed Jun 2, 2024
2 parents 2245f7a + 003d282 commit 100c168
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 199 deletions.
108 changes: 0 additions & 108 deletions .github/workflows/action.yml

This file was deleted.

86 changes: 86 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Build for Windows, Release

on:
push:
branches: [ 'main' ]
tags: # Added to trigger the workflow on version tags
- 'v*'
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: windows-latest

steps:
# Check-out repository
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: |
**/requirements*.txt
- name: Install Dependencies
run: |
python -m pip install --user virtualenv
virtualenv .venv
. .venv/Scripts/activate
pip install pyinstaller
pip install -r requirements.txt
- name: Build .exe for Windows
run: |
. .venv/Scripts/activate
pyinstaller -y --onefile --hidden-import=yaml --hidden-import=yaml.loader --hidden-import=colorlog `
--paths=.\.venv\Lib\site-packages\ --add-data "config/log_config.yaml;config" `
--add-data "modules/database/create_table_songs.sql;modules/database" `
--add-data "modules/database/create_table_songs_enhanced.sql;modules/database" `
--distpath . run.py
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }} Build
path: |
*.exe
# release:
# if: startsWith(github.ref, 'refs/tags/v')
# runs-on: ubuntu-latest
# needs: build
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
#
# # Download artifacts from previous build steps
# - name: Download Windows Artifact
# uses: actions/download-artifact@v4
# with:
# name: Windows Build
# path: ./artifacts
#
#
# # Log files after download
# - name: List files after download
# run: ls -R ./artifacts
#
# # Rename Windows artifact to a suitable name
# - name: Rename Windows artifact
# run: mv ./artifacts/run.exe ./artifacts/RocksmithServant-${{ github.ref_name }}.exe
#
# # Create a GitHub release
# - name: Release
# uses: softprops/action-gh-release@v2
# if: startsWith(github.ref, 'refs/tags/')
# with:
# tag_name: ${{ github.ref }}
# name: ${{ github.ref_name }}
# files: |
# ./artifacts/*.exe
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 22 additions & 26 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '38 5 * * 0'

Expand All @@ -30,12 +27,11 @@ jobs:
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# only required for workflows in private repositories
actions: read
contents: read
# required for all workflows
security-events: write

strategy:
fail-fast: false
Expand All @@ -47,28 +43,28 @@ jobs:
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

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

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
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.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
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.

# For more 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
# For more 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, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# ℹ️ 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.
Expand All @@ -78,7 +74,7 @@ jobs:
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
33 changes: 18 additions & 15 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
name: Pylint

on: [push]
on:
push

jobs:
build:
pylint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
python-version: [ "3.12" ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py') --disable=missing-docstring --disable=too-few-public-methods
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
# TODO remove --disable=fixme while resolving issue #217
pylint $(git ls-files '*.py') --disable=missing-docstring --disable=too-few-public-methods --disable=fixme \
--ignore-paths='^new_stuffs_to_try_out/.*$'
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package
name: Run tests

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
push

jobs:
build:

runs-on: ubuntu-latest
pytest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: [ "3.11" ]

python-version: [ "3.12" ]
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install dependencies ${{ matrix.os }}
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -r requirements.txt
- 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: Test with pytest
- name: Test with pytest for Linux
if: matrix.os == 'ubuntu-latest'
run: |
PYTHONPATH=. pytest
- name: Test with pytest for Windows
if: matrix.os == 'windows-latest'
run: |
$env:PYTHONPATH=$pwd
pytest
- name: Build EXE from Python Script
uses: Nuitka/[email protected]
Loading

0 comments on commit 100c168

Please sign in to comment.