From a3820d555148c3eed3f8d5e7f0d139b14257ae50 Mon Sep 17 00:00:00 2001 From: Tom Hu Date: Fri, 23 Feb 2024 16:08:48 -0800 Subject: [PATCH] fix: add tests for container --- .github/workflows/ci.yml | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb55e118..7f5d3ab2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,42 @@ jobs: if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} run: | codecovcli do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} - codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} + codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} + + build-test-upload-container: + runs-on: ubuntu-latest + container: cicirello/pyaction:latest + strategy: + fail-fast: false + matrix: + include: + - python-version: "3.11" + - python-version: "3.10" + - python-version: "3.9" + - python-version: "3.8" + steps: + - uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 2 + - name: Set up Python ${{matrix.python-version}} + uses: actions/setup-python@v3 + with: + python-version: "${{matrix.python-version}}" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + python setup.py develop + pip install -r tests/requirements.txt + - name: Test with pytest + run: | + pytest --cov --junitxml=junit.xml + - name: Dogfooding codecov-cli + if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} + run: | + codecovcli do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} + codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} static-analysis: runs-on: ubuntu-latest