mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
Merge pull request #189 from ForgeFlow/14.0-fix-ci
[14.0][UPD] migrate CI to github actions
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
# Do NOT update manually; changes here will be overwritten by Copier
|
||||
_commit: v1.1.1
|
||||
_commit: v1.3.5
|
||||
_src_path: https://github.com/OCA/oca-addons-repo-template.git
|
||||
ci: GitHub
|
||||
dependency_installation_mode: PIP
|
||||
generate_requirements_txt: false
|
||||
include_wkhtmltopdf: true
|
||||
odoo_version: 14.0
|
||||
rebel_module_groups: []
|
||||
repo_description: "TODO: add repo description."
|
||||
repo_description: Return Merchandise Authorization for Odoo
|
||||
repo_name: stock-rma
|
||||
repo_slug: https://github.com/ForgeFlow/stock-rma
|
||||
travis_apt_packages: []
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
env:
|
||||
browser: true
|
||||
es6: true
|
||||
|
||||
# See https://github.com/OCA/odoo-community.org/issues/37#issuecomment-470686449
|
||||
parserOptions:
|
||||
ecmaVersion: 2017
|
||||
|
||||
overrides:
|
||||
- files:
|
||||
- "**/*.esm.js"
|
||||
parserOptions:
|
||||
sourceType: module
|
||||
|
||||
# Globals available in Odoo that shouldn't produce errorings
|
||||
globals:
|
||||
_: readonly
|
||||
@@ -14,7 +21,7 @@ globals:
|
||||
moment: readonly
|
||||
odoo: readonly
|
||||
openerp: readonly
|
||||
Promise: readonly
|
||||
owl: readonly
|
||||
|
||||
# Styling is handled by Prettier, so we only need to enable AST rules;
|
||||
# see https://github.com/OCA/maintainer-quality-tools/pull/618#issuecomment-558576890
|
||||
|
||||
4
.flake8
4
.flake8
@@ -1,5 +1,5 @@
|
||||
[flake8]
|
||||
max-line-length = 80
|
||||
max-line-length = 88
|
||||
max-complexity = 16
|
||||
# B = bugbear
|
||||
# B9 = bugbear opinionated (incl line length)
|
||||
@@ -8,3 +8,5 @@ select = C,E,F,W,B,B9
|
||||
# E501: flake8 line length (covered by bugbear B950)
|
||||
# W503: line break before binary operator (black behaviour)
|
||||
ignore = E203,E501,W503
|
||||
per-file-ignores=
|
||||
__init__.py:F401
|
||||
|
||||
8
.github/workflows/pre-commit.yml
vendored
8
.github/workflows/pre-commit.yml
vendored
@@ -2,7 +2,11 @@ name: pre-commit
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "14.0"
|
||||
push:
|
||||
branches:
|
||||
- "14.0"
|
||||
|
||||
jobs:
|
||||
pre-commit:
|
||||
@@ -10,4 +14,8 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
# The pylint-odoo version we use here does not support python 3.10
|
||||
# https://github.com/OCA/oca-addons-repo-template/issues/80
|
||||
python-version: "3.9"
|
||||
- uses: pre-commit/action@v2.0.0
|
||||
|
||||
44
.github/workflows/test.yml
vendored
Normal file
44
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
name: test Odoo addons
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- "14.0"
|
||||
push:
|
||||
branches:
|
||||
- "14.0"
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
container: ${{ matrix.container }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest
|
||||
makepot: "true"
|
||||
- container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:9.6
|
||||
env:
|
||||
POSTGRES_USER: odoo
|
||||
POSTGRES_PASSWORD: odoo
|
||||
POSTGRES_DB: odoo
|
||||
ports:
|
||||
- 5432:5432
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: Install addons and dependencies
|
||||
run: oca_install_addons
|
||||
- name: Initialize test db
|
||||
run: oca_init_test_database
|
||||
- name: Run tests
|
||||
run: oca_run_tests
|
||||
- uses: codecov/codecov-action@v1
|
||||
- name: Update .pot files
|
||||
run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }}
|
||||
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }}
|
||||
@@ -10,3 +10,4 @@ known_odoo=odoo
|
||||
known_odoo_addons=odoo.addons
|
||||
sections=FUTURE,STDLIB,THIRDPARTY,ODOO,ODOO_ADDONS,FIRSTPARTY,LOCALFOLDER
|
||||
default_section=THIRDPARTY
|
||||
ensure_newline_before_comments = True
|
||||
|
||||
@@ -5,7 +5,7 @@ exclude: |
|
||||
# Files and folders generated by bots, to avoid loops
|
||||
^setup/|/static/description/index\.html$|
|
||||
# We don't want to mess with tool-generated files
|
||||
.svg$|
|
||||
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
|
||||
# Maybe reactivate this when all README files include prettier ignore tags?
|
||||
^README\.md$|
|
||||
# Library files can have extraneous formatting (even minimized)
|
||||
@@ -38,7 +38,13 @@ repos:
|
||||
rev: v1.4
|
||||
hooks:
|
||||
- id: autoflake
|
||||
args: ["-i", "--ignore-init-module-imports"]
|
||||
args:
|
||||
- --expand-star-imports
|
||||
- --ignore-init-module-imports
|
||||
- --in-place
|
||||
- --remove-all-unused-imports
|
||||
- --remove-duplicate-keys
|
||||
- --remove-unused-variables
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 20.8b1
|
||||
hooks:
|
||||
@@ -47,12 +53,13 @@ repos:
|
||||
rev: v2.1.2
|
||||
hooks:
|
||||
- id: prettier
|
||||
name: prettier + plugin-xml
|
||||
name: prettier (with plugin-xml)
|
||||
additional_dependencies:
|
||||
- "prettier@2.1.2"
|
||||
- "@prettier/plugin-xml@0.12.0"
|
||||
args:
|
||||
- --plugin=@prettier/plugin-xml
|
||||
files: \.(css|htm|html|js|json|jsx|less|md|scss|toml|ts|xml|yaml|yml)$
|
||||
- repo: https://github.com/pre-commit/mirrors-eslint
|
||||
rev: v7.8.1
|
||||
hooks:
|
||||
@@ -87,6 +94,7 @@ repos:
|
||||
rev: v2.7.2
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: ["--keep-percent-format"]
|
||||
- repo: https://github.com/PyCQA/isort
|
||||
rev: 5.5.1
|
||||
hooks:
|
||||
@@ -103,13 +111,7 @@ repos:
|
||||
rev: 3.8.3
|
||||
hooks:
|
||||
- id: flake8
|
||||
name: flake8 except __init__.py
|
||||
exclude: /__init__\.py$
|
||||
additional_dependencies: ["flake8-bugbear==20.1.4"]
|
||||
- id: flake8
|
||||
name: flake8 only __init__.py
|
||||
args: ["--extend-ignore=F401"] # ignore unused imports in __init__.py
|
||||
files: /__init__\.py$
|
||||
name: flake8
|
||||
additional_dependencies: ["flake8-bugbear==20.1.4"]
|
||||
- repo: https://github.com/PyCQA/pylint
|
||||
rev: pylint-2.5.3
|
||||
|
||||
@@ -31,9 +31,8 @@ env:
|
||||
- MQT_DEP=PIP
|
||||
|
||||
install:
|
||||
- git clone -b master-eficent
|
||||
https://github.com/ForgeFlow/maintainer-quality-tools.git
|
||||
$HOME/maintainer-quality-tools
|
||||
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git
|
||||
${HOME}/maintainer-quality-tools
|
||||
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
|
||||
- travis_install_nightly
|
||||
|
||||
Reference in New Issue
Block a user