Skip to content

Commit

Permalink
Tests: Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
BLKSerene committed Jun 21, 2024
1 parent b7f669c commit 7175019
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 55 deletions.
28 changes: 14 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ jobs:
# macOS
macOS:
macos:
xcode: 14.1.0
resource_class: macos.x86.medium.gen2
xcode: 14.2.0
resource_class: macos.m1.medium.gen1

steps:
- checkout
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
# Linux
Linux:
machine:
image: ubuntu-2004:2022.10.1
image: ubuntu-2004:2023.07.1
resource_class: medium

steps:
Expand All @@ -130,10 +130,10 @@ jobs:

- run:
command: |
pip3.10 install --upgrade pip setuptools
pip3.10 install --requirement requirements/requirements_tests.txt
pip3.11 install --upgrade pip setuptools
pip3.11 install --requirement requirements/requirements_tests.txt
# Download models and data files
python3.10 utils/wl_downloader_ci.py
python3.11 utils/wl_downloader_ci.py
name: Install dependencies

# Run tests
Expand All @@ -144,15 +144,15 @@ jobs:
export QT_QPA_PLATFORM=offscreen
# Use "python -m pytest" instead to fix "pytest: command not found"
python3.10 -m pytest tests/tests_nlp/tests_spacy/test_spacy_eng.py
python3.10 -m pytest tests/tests_nlp/tests_stanza/test_stanza_eng.py
python3.11 -m pytest tests/tests_nlp/tests_spacy/test_spacy_eng.py
python3.11 -m pytest tests/tests_nlp/tests_stanza/test_stanza_eng.py
python3.10 -m pytest tests/tests_nlp/test_word_tokenization.py
python3.10 -m pytest tests/tests_nlp/test_pos_tagging.py
python3.10 -m pytest tests/tests_nlp/test_lemmatization.py
python3.11 -m pytest tests/tests_nlp/test_word_tokenization.py
python3.11 -m pytest tests/tests_nlp/test_pos_tagging.py
python3.11 -m pytest tests/tests_nlp/test_lemmatization.py
python3.10 -m pytest tests/tests_nlp/ --ignore=tests/tests_nlp/tests_spacy --ignore=tests/tests_nlp/tests_stanza --ignore=tests/tests_nlp/test_word_tokenization.py --ignore=tests/tests_nlp/test_pos_tagging.py --ignore=tests/tests_nlp/test_lemmatization.py
python3.10 -m pytest --ignore=tests/tests_nlp --ignore=tests/tests_settings
python3.11 -m pytest tests/tests_nlp/ --ignore=tests/tests_nlp/tests_spacy --ignore=tests/tests_nlp/tests_stanza --ignore=tests/tests_nlp/test_word_tokenization.py --ignore=tests/tests_nlp/test_pos_tagging.py --ignore=tests/tests_nlp/test_lemmatization.py
python3.11 -m pytest --ignore=tests/tests_nlp --ignore=tests/tests_settings
name: Run tests

# Save cache
Expand All @@ -165,7 +165,7 @@ jobs:
# Docker
Docker:
docker:
- image: cimg/python:3.10
- image: cimg/python:3.11
resource_class: large

steps:
Expand Down
69 changes: 43 additions & 26 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,62 +15,79 @@ on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '30 0 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
name: Analyze (${{ matrix.language }})
# 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 (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
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

include:
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# 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
# 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, 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

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ 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
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
architecture: 'x64'

- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: 'requirements/requirements_tests.txt'
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: 'requirements/requirements_tests.txt'
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: '3.11'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: 'requirements/requirements_tests.txt'
Expand Down
2 changes: 1 addition & 1 deletion .sonarcloud.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ sonar.sourceEncoding=UTF-8
# sonar.cpd.exclusions=

# Python version (for python projects only)
sonar.python.version=3.10
sonar.python.version=3.11
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ environment:
matrix:
# Windows
- APPVEYOR_BUILD_WORKER_IMAGE: "Visual Studio 2019"
PYTHON: "C:/Python310-x64"
PYTHON: "C:/Python311-x64"
# MacOS
- APPVEYOR_BUILD_WORKER_IMAGE: "macos-catalina"
PYTHON: "~/venv3.10"
PYTHON: "~/venv3.11"
# Linux
- APPVEYOR_BUILD_WORKER_IMAGE: "Ubuntu1804"
PYTHON: "$HOME/venv3.10"
PYTHON: "$HOME/venv3.11"

cache:
# Windows
Expand All @@ -38,7 +38,7 @@ cache:
# Linux
- '/home/appveyor/.cache/pip -> requirements/requirements_tests.txt'

stack: python 3.10
stack: python 3.11

build: off

Expand Down
12 changes: 6 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.10'
versionSpec: '3.11'
architecture: 'x64'

- task: Cache@2
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.10'
versionSpec: '3.11'

- task: Cache@2
inputs:
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.10'
versionSpec: '3.11'

- task: Cache@2
inputs:
Expand All @@ -117,10 +117,10 @@ jobs:
displayName: Cache pip packages

- script: |
pip3.10 install --upgrade pip setuptools
pip3.10 install --requirement requirements/requirements_tests.txt
pip3.11 install --upgrade pip setuptools
pip3.11 install --requirement requirements/requirements_tests.txt
# Download models and data files
python3.10 utils/wl_downloader_ci.py
python3.11 utils/wl_downloader_ci.py
displayName: 'Install dependencies'
- script: |
Expand Down

0 comments on commit 7175019

Please sign in to comment.