diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index e9e644a5..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: run-core-tests -jobs: - test: - name: Install and test Core - strategy: - max-parallel: 4 - matrix: - os: [macos-11] - python-version: [ 3.8, 3.9 ] - fail-fast: false - runs-on: ${{ matrix.os }} - if: github.event.pull_request.draft == false - env: - CP_MYSQL_TEST_HOST: "127.0.0.1" - CP_MYSQL_TEST_DB: "cellprofiler_test" - CP_MYSQL_TEST_USER: "root" - CP_MYSQL_TEST_PASSWORD: "None" - steps: - - uses: actions/checkout@v2 - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - architecture: x64 - python-version: ${{ matrix.python-version }} - - name: Get pip cache dir - id: pip-cache-dir - run: | - echo "::set-output name=dir::$(pip cache dir)" - - name: Cache pip - uses: actions/cache@v3 - id: cache-pip - with: - path: ${{ steps.pip-cache-dir.outputs.dir }} - key: ${{ runner.os }}-${{ env.pythonLocation }}-${{ hashFiles('**/setup.py') }} - - name: Install java - uses: actions/setup-java@v1 - with: - java-version: '14.0.1' # The JDK version to make available on the path. - java-package: jdk - architecture: x64 - - name: Mac - Install and setup mysql - if: startsWith(matrix.os, 'macos') - env: - LC_ALL: "en_US.UTF-8" - run: | - brew install mysql - mysql.server start - mysql --host=$CP_MYSQL_TEST_HOST --user=$CP_MYSQL_TEST_USER --execute="CREATE DATABASE $CP_MYSQL_TEST_DB;" --skip-password - - name: Installation - run: - | - pip install pyinstaller - pip install --upgrade pip setuptools wheel - pip install numpy>=1.20.1 - # git clone https://github.com/CellProfiler/CellProfiler.git ~/cellprofiler - pip install -e .[test] - # pip install -e ~/cellprofiler - - name: Test - run: pytest -k 'not test_load_objects and not test_load_single_object' -on: - pull_request: - types: [opened, reopened, synchronize, ready_for_review, review_requested] - push: - branches: - - 'master' - workflow_dispatch: - diff --git a/.github/workflows/upload.yml b/.github/workflows/upload.yml index a2cc1006..44f430c9 100644 --- a/.github/workflows/upload.yml +++ b/.github/workflows/upload.yml @@ -1,24 +1,32 @@ -name: Upload +name: Build on: - release: - types: [created] + push: + pull_request: + jobs: - deploy: + build: + name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Upload - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.8' + - name: Build package + run: | + git fetch --prune --unshallow --tags --force + python -m pip install --upgrade pip + python -m pip install setuptools wheel + python setup.py sdist bdist_wheel + - name: Artifact upload + uses: actions/upload-artifact@v4 + with: + path: dist/*.whl + retention-days: 30 + - name: Create release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v2 + with: + files: dist/*.whl + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}