diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 438130110..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: Build - -on: [push, pull_request] - -jobs: - build: - name: Build - runs-on: ubuntu-latest - env: - PYTHON_VERSION: '3.11' - steps: - - uses: actions/checkout@v3 - - - name: Fetch tags upstream - # Needs to fetch the tags from upstream to get the - # correct version with setuptools_scm - run: | - git remote add upstream https://github.com/hyperspy/exspy.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 pypa/twine - run: | - pip install build twine - - - name: Build a binary wheel and a source tarball - run: | - python -m build - - - name: Display content dist folder - run: | - ls -l dist/ - - - name: Run twin check - run: | - twine check 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.11' - 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 distribution - run: | - pip install --pre --find-links dist exspy[tests] - - - name: Test distribution - run: | - pytest --pyargs exspy diff --git a/.github/workflows/package_and_test.yml b/.github/workflows/package_and_test.yml new file mode 100644 index 000000000..b29f9f44f --- /dev/null +++ b/.github/workflows/package_and_test.yml @@ -0,0 +1,8 @@ +name: Package & Test + +on: [push, pull_request] + +jobs: + package_and_test: + # Use the "reusable workflow" from the hyperspy organisation + uses: hyperspy/.github/.github/workflows/package_and_test.yml@main