|
| 1 | +name: tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: |
| 6 | + - "14.0*" |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - "14.0" |
| 10 | + - "14.0-ocabot-*" |
| 11 | + |
| 12 | +jobs: |
| 13 | + unreleased-deps: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + name: Detect unreleased dependencies |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + - run: | |
| 19 | + for reqfile in requirements.txt test-requirements.txt ; do |
| 20 | + if [ -f ${reqfile} ] ; then |
| 21 | + result=0 |
| 22 | + # reject non-comment lines that contain a / (i.e. URLs, relative paths) |
| 23 | + grep "^[^#].*/" ${reqfile} || result=$? |
| 24 | + if [ $result -eq 0 ] ; then |
| 25 | + echo "Unreleased dependencies found in ${reqfile}." |
| 26 | + exit 1 |
| 27 | + fi |
| 28 | + fi |
| 29 | + done |
| 30 | + test: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + container: ${{ matrix.container }} |
| 33 | + name: ${{ matrix.name }} |
| 34 | + strategy: |
| 35 | + fail-fast: false |
| 36 | + matrix: |
| 37 | + include: |
| 38 | + - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest |
| 39 | + include: "purchase_cancel_reason" |
| 40 | + makepot: "true" |
| 41 | + name: test with Odoo |
| 42 | + - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest |
| 43 | + include: "purchase_cancel_reason" |
| 44 | + name: test with OCB |
| 45 | + - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest |
| 46 | + include: "purchase_cancel_confirm" |
| 47 | + makepot: "true" |
| 48 | + name: test with Odoo |
| 49 | + - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest |
| 50 | + include: "purchase_cancel_confirm" |
| 51 | + name: test with OCB |
| 52 | + - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest |
| 53 | + include: "purchase_order_type" |
| 54 | + makepot: "true" |
| 55 | + name: test with Odoo |
| 56 | + - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest |
| 57 | + include: "purchase_order_type" |
| 58 | + name: test with OCB |
| 59 | + - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest |
| 60 | + include: "purchase_quick" |
| 61 | + makepot: "true" |
| 62 | + name: test with Odoo |
| 63 | + - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest |
| 64 | + include: "purchase_quick" |
| 65 | + name: test with OCB |
| 66 | + - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest |
| 67 | + exclude: "purchase_cancel_reason,purchase_cancel_confirm,purchase_order_type,purchase_quick" |
| 68 | + makepot: "true" |
| 69 | + name: test with Odoo |
| 70 | + - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest |
| 71 | + exclude: "purchase_cancel_reason,purchase_cancel_confirm,purchase_order_type,purchase_quick" |
| 72 | + name: test with OCB |
| 73 | + services: |
| 74 | + postgres: |
| 75 | + image: postgres:9.6 |
| 76 | + env: |
| 77 | + POSTGRES_USER: odoo |
| 78 | + POSTGRES_PASSWORD: odoo |
| 79 | + POSTGRES_DB: odoo |
| 80 | + ports: |
| 81 | + - 5432:5432 |
| 82 | + env: |
| 83 | + INCLUDE: "${{ matrix.include }}" |
| 84 | + EXCLUDE: "${{ matrix.exclude }}" |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@v2 |
| 87 | + with: |
| 88 | + persist-credentials: false |
| 89 | + - name: Install addons and dependencies |
| 90 | + run: oca_install_addons |
| 91 | + - name: Check licenses |
| 92 | + run: manifestoo -d . check-licenses |
| 93 | + - name: Check development status |
| 94 | + run: manifestoo -d . check-dev-status --default-dev-status=Beta |
| 95 | + - name: Initialize test db |
| 96 | + run: oca_init_test_database |
| 97 | + - name: Run tests |
| 98 | + run: oca_run_tests |
| 99 | + - uses: codecov/codecov-action@v1 |
| 100 | + - name: Update .pot files |
| 101 | + run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }} |
| 102 | + if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }} |
0 commit comments