refactor: use model_serializer to serialze the style configs #418
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Unit Test | |
on: | |
push: | |
branches: ["main", "develop"] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
build-shared-library: | |
strategy: | |
matrix: | |
# Currently use ubuntu 20.04 to aviod GLIBC verion issue | |
runs-on: [ubuntu-20.04, windows-latest, macos-13] | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Golang | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22.x' | |
check-latest: true | |
- name: Build shared library | |
run: | | |
go env -w CGO_ENABLED="1" | |
make | |
- name: Set file name windows | |
if: matrix.runs-on == 'windows-latest' | |
shell: pwsh | |
run: | | |
echo "filename=pyfastexcel.dll" >> $env:GITHUB_ENV | |
- name: Set file name ubuntu | |
if: matrix.runs-on == 'ubuntu-latest' | |
run: echo "filename=pyfastexcel.so" >> "$GITHUB_ENV" | |
- name: Set file name macos | |
if: matrix.runs-on == 'macos-13' | |
run: echo "filename=pyfastexcel.dylib" >> "$GITHUB_ENV" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.runs-on }}-shared-library | |
path: ./pyfastexcel/${{ env.filename }} | |
python-test-ubuntu: | |
name: py-unittest-ubuntu | |
needs: [build-shared-library] | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- uses: actions/checkout@v4 | |
- name: Download All Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- run: | | |
mv ./pyfastexcel.so ./pyfastexcel | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sed -i '/^[^#]/s/==.*//' requirements-dev.txt | |
python -m pip install --upgrade pip | |
if [ -f requirements-dev.txt ]; | |
then pip install -r requirements-dev.txt; | |
fi | |
- name: Run tests to generate coverage statistics | |
env: | |
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
run: | | |
pytest --cov --cov-report=term --cov-report xml:py_coverage.xml | |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r py_coverage.xml | |
- name: Upload coverage reports to Codecov | |
if: ${{matrix.python-version}} == '3.11' && ${{matrix.runs-on}} == 'ubuntu-latest' | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
slug: Zncl2222/pyfastexcel | |
file: py_coverage.xml | |
python-test-windows: | |
name: py-unittest-windows | |
needs: [build-shared-library] | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
- uses: actions/checkout@v4 | |
- name: Download All Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- run: | | |
mv ./pyfastexcel.dll ./pyfastexcel | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements-dev.txt; | |
- name: Run tests | |
run: | | |
pytest --cov --cov-report=term --cov-report xml:py_coverage.xml | |
python-test-macos: | |
name: py-unittest-macos | |
needs: [build-shared-library] | |
strategy: | |
max-parallel: 5 | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Download All Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
merge-multiple: true | |
- run: | | |
mv ./pyfastexcel.dylib ./pyfastexcel | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
- name: Run tests | |
run: | | |
pytest --cov --cov-report=term --cov-report xml:py_coverage.xml |