Skip to content

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #63

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #63

Workflow file for this run

name: Test
on:
push:
branches:
- v2-main
- v2-dev
- v2/github-actions
pull_request:
types: [opened, synchronize, reopened]
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install deps
run: |
python -m pip install --upgrade pip
python scripts/install_tf.py 2.2
python scripts/install_addons.py 2.2
pip install -r requirements.dev.txt
pip install -r requirements.txt
- name: Run lint script
run: sh ./scripts/lint.sh
test:
if: always()
name: "Test with TF ${{ matrix.tensorflow_version }} - ${{ matrix.group }}"
needs: lint
runs-on: ubuntu-latest
strategy:
matrix:
group: [ 1, 2, 3 ]
tensorflow_version: [2.2, 2.3, 2.4, 2.5]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install deps
run: |
python -m pip install --upgrade pip
python scripts/install_tf.py '${{ matrix.tensorflow_version }}'
python scripts/install_addons.py '${{ matrix.tensorflow_version }}'
pip install -r requirements.dev.txt
pip install -r requirements.txt
- name: Run pytest
run: 'pytest
--doctest-modules
--junitxml=test-reports/junit-${{ matrix.tensorflow_version }}-${{ matrix.group }}.xml
--cov=kashgari
--cov-report=xml:cov-reports/coverage-${{ matrix.tensorflow_version }}-${{ matrix.group }}.xml
--cov-report term
--cov-config .coveragerc
--cov
--splits 3
--group ${{ matrix.group }}
tests/'
- name: Upload unit test
uses: actions/upload-artifact@v2
with:
name: junitxml-${{ matrix.tensorflow_version }}-${{ matrix.group }}
path: test-reports
- name: Upload coverage
uses: actions/upload-artifact@v2
with:
name: coverage-${{ matrix.tensorflow_version }}-${{ matrix.group }}
path: cov-reports
sonarcloud:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: SonarCloud
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: actions/download-artifact@v4.1.7
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R
- name: Copy Artifacts to target file
run: |
mkdir -p test-reports && cp artifacts/junit*/* test-reports
mkdir -p cov-reports && cp artifacts/cov*/* cov-reports
- name: Display structure of downloaded files
run: ls -R
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# - name: Publish Unit Test Results
# uses: EnricoMi/publish-unit-test-result-action@v1.3
# if: always()
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# check_name: Unit Test Results
# files: test-results/*.xml
# report_individual_runs: true
# deduplicate_classes_by_file_name: false