From 9aeefc15a0b3155f045c30c6aa9c15cbef8ad3d0 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Thu, 21 Nov 2024 18:05:47 -0500 Subject: [PATCH 1/4] install pip.txt using pip insteaad of conda --- .github/workflows/tests-on-pr.yml | 51 ++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 36e0561..8925cb6 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -8,11 +8,46 @@ on: workflow_dispatch: jobs: - tests-on-pr: - uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0 - with: - project: diffpy.labpdfproc - c_extension: false - headless: false - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + validate: + defaults: + run: + shell: bash -l {0} + + runs-on: ubuntu-latest + steps: + - name: Check out diffpy.labpdfproc repository + uses: actions/checkout@v4 + + - name: Initialize miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: test + auto-update-conda: true + environment-file: environment.yml + auto-activate-base: false + python-version: 3.13 + + - name: Conda config + run: >- + conda config --set always_yes yes + --set changeps1 no + + - name: Install diffpy.labpdfproc and requirements + run: | + conda install --file requirements/test.txt + pip install -r requirements/pip.txt + python -m pip install . --no-deps + + + - name: Validate diffpy.labpdfproc + run: | + pytest --cov + coverage report -m + codecov + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + verbose: true + fail_ci_if_error: true + token: secrets.CODECOV_TOKEN \ No newline at end of file From 93e854e68f36d26e41e6ac034130f7e88814ba1d Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Thu, 21 Nov 2024 18:10:12 -0500 Subject: [PATCH 2/4] Also pip install in matrix --- .../matrix-and-codecov-on-merge-to-main.yml | 56 ++++++++++++++++--- 1 file changed, 48 insertions(+), 8 deletions(-) diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml index 1064e0e..e2347f1 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -11,11 +11,51 @@ on: workflow_dispatch: jobs: - matrix-coverage: - uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 - with: - project: diffpy.labpdfproc - c_extension: false - headless: false - secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + coverage: + defaults: + run: + shell: bash -l {0} + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-13, macos-14] + python-version: ["3.11", "3.12", "3.13"] + env: + LATEST_PYTHON_VERSION: "3.13" + steps: + - name: Check out diffpy.labpdfproc + uses: actions/checkout@v4 + + - name: Initialize miniconda + uses: conda-incubator/setup-miniconda@v3 + with: + activate-environment: test + auto-update-conda: true + environment-file: environment.yml + auto-activate-base: false + python-version: ${{ matrix.python-version }} + + - name: Conda config + run: >- + conda config --set always_yes yes + --set changeps1 no + + - name: Install diffpy.labpdfproc and requirements + run: | + conda install --file requirements/test.txt + pip install -r requirements/pip.txt + python -m pip install . --no-deps + + - name: Validate diffpy.labpdfproc + run: | + pytest --cov + coverage report -m + codecov + + - name: Upload coverage to Codecov + if: matrix.os == 'ubuntu-latest' && matrix.python-version == env.LATEST_PYTHON_VERSION + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: secrets.CODECOV_TOKEN \ No newline at end of file From 28df30379844ee5dbf984f5595280e61a5a3c483 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Thu, 21 Nov 2024 18:20:11 -0500 Subject: [PATCH 3/4] Apply pre-commit --- .github/workflows/matrix-and-codecov-on-merge-to-main.yml | 2 +- .github/workflows/tests-on-pr.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml index e2347f1..d69b0cd 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -58,4 +58,4 @@ jobs: if: matrix.os == 'ubuntu-latest' && matrix.python-version == env.LATEST_PYTHON_VERSION uses: codecov/codecov-action@v4 env: - CODECOV_TOKEN: secrets.CODECOV_TOKEN \ No newline at end of file + CODECOV_TOKEN: secrets.CODECOV_TOKEN diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 8925cb6..27c27a5 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -38,7 +38,7 @@ jobs: pip install -r requirements/pip.txt python -m pip install . --no-deps - + - name: Validate diffpy.labpdfproc run: | pytest --cov @@ -50,4 +50,4 @@ jobs: with: verbose: true fail_ci_if_error: true - token: secrets.CODECOV_TOKEN \ No newline at end of file + token: secrets.CODECOV_TOKEN From 0a8c60600de024947f24c980ff0f972ca3a82267 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Thu, 21 Nov 2024 18:30:55 -0500 Subject: [PATCH 4/4] Use {{ }} in secrets.CODECOV_TOKEN --- .github/workflows/matrix-and-codecov-on-merge-to-main.yml | 2 +- .github/workflows/tests-on-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml index d69b0cd..ff4f6de 100644 --- a/.github/workflows/matrix-and-codecov-on-merge-to-main.yml +++ b/.github/workflows/matrix-and-codecov-on-merge-to-main.yml @@ -58,4 +58,4 @@ jobs: if: matrix.os == 'ubuntu-latest' && matrix.python-version == env.LATEST_PYTHON_VERSION uses: codecov/codecov-action@v4 env: - CODECOV_TOKEN: secrets.CODECOV_TOKEN + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/tests-on-pr.yml b/.github/workflows/tests-on-pr.yml index 27c27a5..f089057 100644 --- a/.github/workflows/tests-on-pr.yml +++ b/.github/workflows/tests-on-pr.yml @@ -50,4 +50,4 @@ jobs: with: verbose: true fail_ci_if_error: true - token: secrets.CODECOV_TOKEN + token: ${{ secrets.CODECOV_TOKEN }}