From 3781d6f76b5fc8330a6125b990471e321d0e26e7 Mon Sep 17 00:00:00 2001 From: Scott Lyons Date: Thu, 22 Aug 2024 07:25:56 -0700 Subject: [PATCH] ci(ci_yaml): adding release on tag and unit/integration test running --- .github/workflows/CI.yaml | 56 +++++++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 14 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index e63febf..66d5bae 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -19,6 +19,23 @@ permissions: contents: read jobs: + unit_test: + name: Unit tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - run: cargo test --all-features + rust_integration_test: + name: Rust Integration test + runs-on: ubuntu-latest + steps: + - run: cd tests/rust-test && ./test.sh + python_integration_test: + name: Python Integration test + runs-on: ubuntu-latest + steps: + - run: cd tests/python-sync && ./test.sh linux: runs-on: ${{ matrix.platform.runner }} defaults: @@ -180,17 +197,28 @@ jobs: name: wheels-sdist path: dist - #release: - # name: Release - # runs-on: ubuntu-latest - # if: "startsWith(github.ref, 'refs/tags/')" - # needs: [linux, musllinux, windows, macos, sdist] - # steps: - # - uses: actions/download-artifact@v4 - # - name: Publish to PyPI - # uses: PyO3/maturin-action@v1 - # env: - # MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} - # with: - # command: upload - # args: --non-interactive --skip-existing wheels-*/* + python_release: + name: Python Release + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/')" + needs: [linux, musllinux, windows, macos, sdist] + steps: + - uses: actions/download-artifact@v4 + - name: Publish to PyPI + uses: PyO3/maturin-action@v1 + env: + MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} + with: + command: upload + args: --non-interactive --skip-existing wheels-*/* + crate_release: + name: Crates.io Release + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/tags/')" + needs: [linux, musllinux, windows, macos, sdist] + steps: + - uses: actions/checkout@v4 + - name: Cargo publish + run: cargo publish --token ${CRATES_TOKEN} + env: + CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}