rename secret scope #56
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| types: [ opened, synchronize, reopened ] | |
| workflow_dispatch: | |
| env: | |
| PACKAGE_VERSION: "1.0.${{ github.run_number }}" | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Test Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install pytest pytest-cov | |
| pip install .[test,non_databricks] # Install main dependencies + test dependencies | |
| - name: Run pytest | |
| run: | | |
| pytest --junitxml=test-results-${{ matrix.python-version }}.xml --cov=dataworkbench --cov-report=xml tests/ | |
| # - name: Get Coverage report | |
| # uses: orgoro/[email protected] | |
| # with: | |
| # coverageFile: coverage.xml | |
| # token: ${{ secrets.GITHUB_TOKEN }} | |
| # if: ${{ always() }} | |
| # Step to upload the test results as an artifact | |
| - name: Upload test results as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-${{ matrix.python-version }} | |
| path: test-results-${{ matrix.python-version }}.xml | |
| if: ${{ always() }} | |
| build-package: | |
| needs: build-tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" | |
| - name: Install Dependencies for build | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install build | |
| pip install . | |
| - name: Build package | |
| run: | | |
| python -m build -w | |
| - name: Find and rename .whl file | |
| run: | | |
| # Find the .whl file using a wildcard and rename it | |
| WHL_FILE=$(find . -type f -name "*.whl" -print -quit) | |
| mv "$WHL_FILE" dist/dataworkbench-1.0-py3-none-any.whl | |
| - name: Log package version number | |
| if: github.event_name == 'push' | |
| run: | | |
| # Create a file with just the run number for easier parsing | |
| echo "$PACKAGE_VERSION" > dist/package-version.txt | |
| - name: Publish package artifact | |
| if: github.event_name == 'push' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ |