From 05ecaf8725ccf3af30295347e9bdb3e28630b84f Mon Sep 17 00:00:00 2001 From: angrybayblade Date: Fri, 26 Jul 2024 18:17:03 +0530 Subject: [PATCH] fix: run examples before creating release --- .github/workflows/release.yaml | 51 ++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 79cca915ff1..968d5e50251 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,8 +4,43 @@ on: types: [published] jobs: + test-examples: + name: Run Example Tests + defaults: + run: + working-directory: ./python + strategy: + matrix: + os: [ubuntu-latest] + python-version: ["3.10"] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@master + - uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Run Tests + env: + DOCKER_USER: ${{secrets.DOCKER_USER}} + OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}} + JULEP_API_KEY: ${{secrets.JULEP_API_KEY}} + JULEP_API_URL: ${{secrets.JULEP_API_URL}} + COMPOSIO_API_KEY: ${{secrets.COMPOSIO_API_KEY_PROD}} + run: | + sudo apt-get update --fix-missing + sudo apt-get autoremove + sudo apt-get autoclean + + python -m pip install --upgrade pip pipenv pytest + pipenv install + pipenv run pip3 install '.[all]' + ls -1 plugins | awk '$0="plugins/"$0"/"' | xargs -L1 pipenv run pip3 install + + COMPOSIO_BASE_URL=https://backend.composio.dev/api pytest -vv test/test_example.py + publish-core: name: Create Framework & Plugin Releases + needs: test-examples defaults: run: working-directory: ./python @@ -146,7 +181,7 @@ jobs: cd python/ pip3 install . - + # Build CLI pyinstaller composio/cli/__main__.py @@ -156,7 +191,7 @@ jobs: cd python/ mv dist/__main__ dist/bin mv dist/bin/__main__ dist/bin/composio - + cd dist/ zip -r composio-linux-amd64.zip bin/* rm -rf bin/ @@ -165,14 +200,14 @@ jobs: uses: softprops/action-gh-release@v2 with: files: python/dist/composio-linux-amd64.zip - + # Mac Intel Release - if: matrix.os == 'macos-12' run: | cd python/ mv dist/__main__ dist/bin mv dist/bin/__main__ dist/bin/composio - + cd dist/ zip -r composio-darwin-amd64.zip bin/* rm -rf bin/ @@ -181,14 +216,14 @@ jobs: uses: softprops/action-gh-release@v2 with: files: python/dist/composio-darwin-amd64.zip - + # Mac ARM Release - if: matrix.os == 'macos-14' run: | cd python/ mv dist/__main__ dist/bin mv dist/bin/__main__ dist/bin/composio - + cd dist/ zip -r composio-darwin-arm64.zip bin/* rm -rf bin/ @@ -197,14 +232,14 @@ jobs: uses: softprops/action-gh-release@v2 with: files: python/dist/composio-darwin-arm64.zip - + # # Windows release # - if: matrix.os == 'windows-latest' # run: | # cd python/ # mv dist/__main__ dist/bin # mv dist/bin/__main__.exe dist/bin/composio.exe - + # cd dist/ # zip -r composio-win.zip bin/* # rm -rf bin/