diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 7cb68f693..def8e95f6 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -306,6 +306,87 @@ jobs: asset_name: ${{ steps.build-mac-tarball.outputs.ASSET_NAME }} asset_content_type: application/tar+gzip + TestPythonPackageLinux: + runs-on: ubuntu-latest + needs: [BuildAndPushPythonPackagesLinux, CreateRelease] + strategy: + matrix: + include: + - python: '3.8' + filename-index: 'python-package-name-linux-py38' + - python: '3.9' + filename-index: 'python-package-name-linux-py39' + - python: '3.10' + filename-index: 'python-package-name-linux-py310' + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + + - name: Extract Package Filename + id: extract-filename + run: echo "::set-output name=FILE_NAME::`echo '${{ toJson(needs.BuildAndPushPythonPackagesLinux.outputs) }}' | jq '.[\"${{ matrix.filename-index }}\"]' | tr -d '\"' `" + + - name: Download and Install Package + run: | + wget --auth-no-challenge --header='Accept:application/octet-stream' \ + "https://${{ secrets.GH_TOKEN_RELEASE }}:@api.github.com/repos/zama-ai/homomorphizer/releases/assets/`curl -s -u "zama-bot:${{ secrets.GH_TOKEN_RELEASE }}" \ + https://api.github.com/repos/zama-ai/homomorphizer/releases | \ + jq 'map(select(.tag_name == "${{ github.ref_name }}"))' | \ + jq '.[0].assets' | \ + jq 'map(select(.name == "${{ steps.extract-filename.outputs.FILE_NAME }}" ))' | \ + jq '.[].id'`" -O ${{ steps.extract-filename.outputs.FILE_NAME }} + pip install ${{ steps.extract-filename.outputs.FILE_NAME }} + + - name: Test + run: | + cd compiler + pip install pytest + pytest -vs --ignore=tests/python/test_compiler_file_output/ tests/python + + TestPythonPackageMacOS: + runs-on: macos-10.15 + needs: [BuildAndPushPackagesMacOS, CreateRelease] + strategy: + matrix: + include: + - python: '3.8' + filename-index: 'python-package-name-macos-py38' + - python: '3.9' + filename-index: 'python-package-name-macos-py39' + - python: '3.10' + filename-index: 'python-package-name-macos-py310' + steps: + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + + - name: Extract Package Filename + id: extract-filename + run: echo "::set-output name=FILE_NAME::`echo '${{ toJson(needs.BuildAndPushPackagesMacOS.outputs) }}' | jq '.[\"${{ matrix.filename-index }}\"]' | tr -d '\"' `" + + - name: Download and Install Package + run: | + wget --auth-no-challenge --header='Accept:application/octet-stream' \ + "https://${{ secrets.GH_TOKEN_RELEASE }}:@api.github.com/repos/zama-ai/homomorphizer/releases/assets/`curl -s -u "zama-bot:${{ secrets.GH_TOKEN_RELEASE }}" \ + https://api.github.com/repos/zama-ai/homomorphizer/releases | \ + jq 'map(select(.tag_name == "${{ github.ref_name }}"))' | \ + jq '.[0].assets' | \ + jq 'map(select(.name == "${{ steps.extract-filename.outputs.FILE_NAME }}" ))' | \ + jq '.[].id'`" -O ${{ steps.extract-filename.outputs.FILE_NAME }} + pip install ${{ steps.extract-filename.outputs.FILE_NAME }} + + - name: Test + run: | + cd compiler + pip install pytest + pytest -vs --ignore=tests/python/test_compiler_file_output/ tests/python ################# # Docker Images #