Skip to content

Commit

Permalink
Merge pull request #53 from yukihiko-shinoda/handle-warnings
Browse files Browse the repository at this point in the history
Handle warnings
  • Loading branch information
yukihiko-shinoda authored Aug 5, 2023
2 parents 83d6a54 + 842147d commit 1e4e29d
Show file tree
Hide file tree
Showing 43 changed files with 435 additions and 235 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
env:
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
with:
coverageCommand: python -m pipenv run invoke test.cov --xml
coverageCommand: python -m pipenv run invoke test.coverage --xml
82 changes: 82 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 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: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "master" ]
schedule:
- cron: '44 3 * * 3'

jobs:
analyze:
name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
# 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.

# 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@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}}"
33 changes: 31 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ on:
- master
jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [ '3.11', '3.10', '3.9' ]
fail-fast: false
steps:
Expand All @@ -20,7 +21,15 @@ jobs:
python-version: ${{ matrix.python-version }}
- run: python -m pip install pipenv
- run: python -m pipenv sync --dev
- run: python -m pipenv run test
# Invoke currently seems not support PowerShell,
# production code of this package doesn't depends on cmd, however test depends on cmd.
# - GitHub Actions default shell on Windows runners is changing to PowerShell | GitHub Changelog
# https://github.blog/changelog/2019-10-17-github-actions-default-shell-on-windows-runners-is-changing-to-powershell/
- if: runner.os == 'Windows'
run: python -m pipenv run invoke test.all
shell: cmd
- if: runner.os == 'Linux'
run: python -m pipenv run invoke test.all
check_style:
runs-on: ubuntu-latest
steps:
Expand All @@ -31,3 +40,23 @@ jobs:
- run: python -m pip install pipenv
- run: python -m pipenv sync --dev
- run: python -m pipenv run invoke style --check
check_lint_fast:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: python -m pip install pipenv
- run: python -m pipenv sync --dev
- run: python -m pipenv run invoke lint
check_lint_deep:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: python -m pip install pipenv
- run: python -m pipenv sync --dev
- run: python -m pipenv run invoke lint.deep
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COPY Pipfile Pipfile.lock /workspace/
# see:
# - Fail to pipenv update due to MetadataGenerationFailed · Issue #5377 · pypa/pipenv
# https://github.com/pypa/pipenv/issues/5377
RUN pip --no-cache-dir install pipenv==2023.7.11 \
RUN pip --no-cache-dir install pipenv==2023.7.23 \
&& pipenv install --deploy --system \
&& pip uninstall -y pipenv virtualenv-clone virtualenv
COPY . /workspace
Expand All @@ -20,7 +20,7 @@ ENV PIPENV_VENV_IN_PROJECT=1
# see:
# - Fail to pipenv update due to MetadataGenerationFailed · Issue #5377 · pypa/pipenv
# https://github.com/pypa/pipenv/issues/5377
RUN pip --no-cache-dir install pipenv==2023.7.11 \
RUN pip --no-cache-dir install pipenv==2023.7.23 \
&& pipenv sync --dev
ENTRYPOINT [ "pipenv", "run" ]
CMD ["pytest"]
Loading

0 comments on commit 1e4e29d

Please sign in to comment.