|
| 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@v3 |
| 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-22.04 |
| 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 | + name: test with Odoo |
| 40 | + - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest |
| 41 | + name: test with OCB |
| 42 | + makepot: "true" |
| 43 | + services: |
| 44 | + postgres: |
| 45 | + image: postgres:9.6 |
| 46 | + env: |
| 47 | + POSTGRES_USER: odoo |
| 48 | + POSTGRES_PASSWORD: odoo |
| 49 | + POSTGRES_DB: odoo |
| 50 | + ports: |
| 51 | + - 5432:5432 |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v3 |
| 54 | + with: |
| 55 | + persist-credentials: false |
| 56 | + - name: Install addons and dependencies |
| 57 | + run: oca_install_addons |
| 58 | + - name: Check licenses |
| 59 | + run: manifestoo -d . check-licenses |
| 60 | + - name: Check development status |
| 61 | + run: manifestoo -d . check-dev-status --default-dev-status=Beta |
| 62 | + - name: Initialize test db |
| 63 | + run: oca_init_test_database |
| 64 | + - name: Run tests |
| 65 | + run: oca_run_tests |
| 66 | + - uses: codecov/codecov-action@v4 |
| 67 | + with: |
| 68 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 69 | + - name: Update .pot files |
| 70 | + run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }} |
| 71 | + if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'OCA' }} |
0 commit comments