Skip to content

Fix codecov action

Fix codecov action #20

Workflow file for this run

---
name: test
on:
push:
branches:
- master
pull_request:
env:
GO111MODULE: "on"
jobs:
setup:
runs-on: ubuntu-latest
outputs:
go-latest-version: ${{ steps.find-go-version.outputs.go-latest-version }}
go-supported-versions: ${{ steps.find-go-version.outputs.go-supported-versions }}
python-version: ${{ steps.setup.outputs.PYTHON_VERSION }}
steps:
- name: Checkout code
uses: nhatthm/gh-actions/checkout@master
- id: find-go-version
name: Find Go version
uses: nhatthm/gh-actions/find-go-version@master
- name: Setup
id: setup
run: |
make "$GITHUB_OUTPUT"
test:
strategy:
fail-fast: false
matrix:
go-version: ${{ fromJson(needs.setup.outputs.go-supported-versions) }}
runs-on: ubuntu-latest
container:
image: python:${{ needs.setup.outputs.python-version }}-bookworm
needs: [setup]
env:
GO_LATEST_VERSION: ${{ needs.setup.outputs.go-latest-version }}
steps:
- name: Checkout code
uses: nhatthm/gh-actions/checkout@master
- name: Install Go
uses: nhatthm/gh-actions/setup-go@master
with:
go-version: ${{ matrix.go-version }}
- name: Setup Environment
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
make "$GITHUB_ENV"
- name: Install Dependencies
shell: bash
env:
PYTHON_VERSION: ${{ needs.setup.outputs.python-version }}
run: |
apt-get update
apt-get install -y python3-dev python3-fontforge
ln -s /usr/lib/python3/dist-packages/fontforge.cpython-${PYTHON_VERSION//.}-x86_64-linux-gnu.so /usr/local/lib/python${PYTHON_VERSION}/site-packages/fontforge.so
ln -s /usr/lib/python3/dist-packages/psMat.cpython-${PYTHON_VERSION//.}-x86_64-linux-gnu.so /usr/local/lib/python${PYTHON_VERSION}/site-packages/psMat.so
- name: Test
run: |
make test
- name: Upload code coverage (unit)
if: matrix.go-version == env.GO_LATEST_VERSION
uses: nhatthm/gh-actions/codecov@master
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./unit.coverprofile
flags: unittests-${{ runner.os }}
#- name: Upload code coverage (features)
# if: matrix.go-version == env.GO_LATEST_VERSION
# uses: nhatthm/gh-actions/codecov@master
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# file: ./features.coverprofile
# flags: featurestests-${{ runner.os }}