diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 00000000..34f20df4 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,36 @@ +name: Workflow for CI and Codecov Action +on: [push, pull_request] +jobs: + run: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + env: + OS: ${{ matrix.os }} + PYTHON: '3.9' + steps: + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: 3.9 + - name: Install dependencies + run: | + pip install pytest + pip install pytest-cov + pip install -e . + - name: Generate coverage report + run: | + pytest --cov=./ --cov-report=xml + - name: Upload coverage to Codecov + if: success() || failure() + uses: codecov/codecov-action@v4 + with: + env_vars: OS,PYTHON + file: ./coverage.xml + flags: unittests + name: codecov-umbrella + token: ${{ secrets.CODECOV_TOKEN }} + slug: facebookresearch/Pearl + verbose: true diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml deleted file mode 100644 index 2950b905..00000000 --- a/.github/workflows/codecov.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: CodeCov -on: [push, pull_request] -jobs: - run: - runs-on: ubuntu-latest - env: - OS: ubuntu-latest - PYTHON: '3.9' - steps: - - uses: checkout@v4 - - name: Setup Python - uses: actions/setup-python@main - with: - python-version: 3.9 - - name: Install Pearl - run: | - pip install -e . - - name: Generate Report - run: | - pip install coverage - coverage run -m unittest - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 9082560a..2c05e0de 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Support Ukraine](https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat&labelColor=005BBB)](https://opensource.fb.com/support-ukraine) +[![codecov](https://codecov.io/gh/facebookresearch/Pearl/graph/badge.svg?token=CARFOP3E30)](https://codecov.io/gh/facebookresearch/Pearl) More details of the library at our [official website](https://pearlagent.github.io).