diff --git a/.github/workflows/addon-check.yml b/.github/workflows/addon-check.yml index a1ab43fb..194543c3 100644 --- a/.github/workflows/addon-check.yml +++ b/.github/workflows/addon-check.yml @@ -3,16 +3,19 @@ name: Kodi on: -- pull_request -- push + # Run action when pushed to master, or for commits in a pull request. + push: + branches: + - master + pull_request: + branches: + - master jobs: tests: name: Addon checker runs-on: ubuntu-latest strategy: fail-fast: false - matrix: - kodi-branch: [krypton, leia, matrix] steps: - uses: actions/checkout@v4 with: @@ -23,18 +26,10 @@ jobs: python-version: 3.8 - name: Install dependencies run: | - sudo apt-get install xmlstarlet python -m pip install --upgrade pip pip install git+https://github.com/xbmc/addon-check.git - name: Remove unwanted files run: awk '/export-ignore/ { print $1 }' .gitattributes | xargs rm -rf -- working-directory: ${{ github.repository }} - - name: Rewrite addon.xml for older versions - run: | - xmlstarlet ed -L -u '/addon/requires/import[@addon="xbmc.python"]/@version' -v "2.25.0" addon.xml - version=$(xmlstarlet sel -t -v 'string(/addon/@version)' addon.xml) - xmlstarlet ed -L -u '/addon/@version' -v "${version%'+matrix.1'}" addon.xml - working-directory: ${{ github.repository }} - if: matrix.kodi-branch == 'krypton' || matrix.kodi-branch == 'leia' - name: Run kodi-addon-checker - run: kodi-addon-checker --branch=${{ matrix.kodi-branch }} ${{ github.repository }}/ + run: kodi-addon-checker --branch=matrix ${{ github.repository }}/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 853826e5..e7723d25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: env: PYTHONIOENCODING: utf-8 PYTHONPATH: ${{ github.workspace }}/resources/lib:${{ github.workspace }}/tests + PYPI-HOSTS: "pypi.python.org pypi.org files.pythonhosted.org" strategy: fail-fast: false matrix: @@ -37,19 +38,15 @@ jobs: steps: - name: Check out ${{ github.sha }} from repository ${{ github.repository }} uses: actions/checkout@v4 - - name: Ignore certificate verification on Python 3.5 - shell: bash - run: > - # INSECURE!! But it should be OK for CI tests. - echo 'PIP_TRUSTED_HOST=pypi.python.org pypi.org - files.pythonhosted.org' >>$GITHUB_ENV - name: Setup PYTHONPATH (windows) if: contains(matrix.os, 'windows') run: echo "PYTHONPATH=${env:PYTHONPATH};${env:GITHUB_WORKSPACE};${env:GITHUB_WORKSPACE}\resources\lib;${env:GITHUB_WORKSPACE}\tests" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf-8 -Append - name: 'Set up Python ${{ matrix.python-version }}' - uses: MatteoH2O1999/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + env: + PIP_TRUSTED_HOST: ${{ contains(fromJson('["3.5"]'), matrix.python-version) && env.PYPI-HOSTS || '' }} - name: Install dependencies (linux) if: contains(matrix.os, 'ubuntu') run: | @@ -90,12 +87,18 @@ jobs: run: coverage run -a tests/run.py / if: always() - name: Upload code coverage to CodeCov - if: contains(matrix.os, 'ubuntu') - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 continue-on-error: true + env: + OS: '${{ matrix.os }}' + PYTHON: '${{ matrix.python-version }}' + with: + token: '${{ secrets.CODECOV_TOKEN }}' + flags: unittests + env_vars: 'OS,PYTHON' - name: Analyze with SonarCloud if: contains(matrix.os, 'ubuntu') - uses: SonarSource/sonarcloud-github-action@v1.8 + uses: SonarSource/sonarcloud-github-action@v3 with: args: > -Dsonar.organization=add-ons