diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 4943cec9d..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Build - -on: [push, pull_request] - -jobs: - build: - name: Build - runs-on: ubuntu-latest - env: - PYTHON_VERSION: '3.10' - steps: - - uses: actions/checkout@v4 - - - name: Checkout - # Needs to fetch the tags from upstream to get the - # correct version with setuptools_scm - run: | - git remote add upstream https://github.com/hyperspy/rosettasciio.git - git fetch --prune --unshallow - git fetch upstream --tags - - - uses: actions/setup-python@v4 - name: Install Python - with: - python-version: ${{ env.PYTHON_VERSION }} - - - name: Display version - run: | - python --version - pip --version - - - name: Install pypa/build - run: | - pip install build - - - name: Build a binary wheel and a source tarball - run: | - python -m build - - - name: Display content dist folder - run: | - ls -l dist/ - - - uses: actions/upload-artifact@v3 - with: - path: ./dist/* - name: dist - - test: - name: Test Packaging - needs: build - runs-on: ubuntu-latest - env: - PYTHON_VERSION: '3.10' - steps: - - uses: actions/setup-python@v4 - name: Install Python - with: - python-version: ${{ env.PYTHON_VERSION }} - - - uses: actions/download-artifact@v3 - - - name: Display content working folder - run: | - ls -R - - - name: Install HyperSpy (dev) - run: | - pip install git+https://github.com/hyperspy/hyperspy.git@RELEASE_next_major - pip install git+https://github.com/hyperspy/exspy.git - - - name: Install distribution - run: | - # uninstall version from installed by hyperspy first - # release otherwise hyperspy install a version and this dist is ignored - pip uninstall --yes rosettasciio - pip install --pre --find-links dist rosettasciio[all,tests] - - - name: Pip list - run: | - pip list - - - name: Test distribution - run: | - # can't use `-n 2` because xdist ignore the `conftest.py` - pytest --pyargs rsciio --reruns 3 diff --git a/.github/workflows/package_and_test.yml b/.github/workflows/package_and_test.yml new file mode 100644 index 000000000..85836292a --- /dev/null +++ b/.github/workflows/package_and_test.yml @@ -0,0 +1,11 @@ +name: Package & Test + +on: [push, pull_request] + +jobs: + package_and_test: + name: Package and Test + # Use the "reusable workflow" from the hyperspy organisation + uses: hyperspy/.github/.github/workflows/package_and_test.yml@main + with: + module_name: rsciio