-
Notifications
You must be signed in to change notification settings - Fork 29
Migrate Travis CI to Github Action #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
3e8be6c
GH workflow for unit tests
dylannguyen11195 3a959a5
Remove aws creds and gh token
dylannguyen11195 8757e72
GHA PyPi release
dylannguyen11195 965c8a7
v1.14.0-rc1
dylannguyen11195 88f7b31
Typo
dylannguyen11195 618aa5d
Update to ubunto-latest
dylannguyen11195 8fcfc33
Overrides runs-on depending on Python version
dylannguyen11195 55bc840
Removed Python 3.6 and 3.7
dylannguyen11195 d12d234
Updated CHANGELOG
dylannguyen11195 e07a052
Refactor into two workflows
dylannguyen11195 256a91e
Convert to xml coverage
dylannguyen11195 5943b52
1.14.0-rc2
dylannguyen11195 ed89a50
Fix release workflow
dylannguyen11195 9a83bf4
v1.14.0-rc4
dylannguyen11195 2af0dd4
Updated documentation for GHA release workflow
dylannguyen11195 32fdb6a
Revert to production version
dylannguyen11195 7746701
Remove .travis.yml
dylannguyen11195 5b88e43
Added unit tests for Python 3.9 -> 3.12
dylannguyen11195 39267e3
Pin to 3.10.17
dylannguyen11195 bb3b7c1
Removed Python 3.12
dylannguyen11195 b7b72d3
Upload artifact for Python 3.8 only
dylannguyen11195 d80d4dc
Remove Python 3.10 and 3.11
dylannguyen11195 46c8966
Empty commit
dylannguyen11195 859a8f3
Added release workflow step to test the distribution
dylannguyen11195 6092061
v1.14.0-rc5
dylannguyen11195 2e7db04
Typo
dylannguyen11195 cdcdbee
1.14.0-rc6
dylannguyen11195 df3e47f
Revert to 1.13.0
dylannguyen11195 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| name: 'Build Python Package' | ||
| description: 'Sets up Python, builds package, and validates it' | ||
| inputs: | ||
| python-version: | ||
| description: 'Python version to use' | ||
| required: false | ||
| default: '3.8' | ||
|
|
||
| runs: | ||
| using: "composite" | ||
| steps: | ||
| - name: Set up Python ${{ inputs.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ inputs.python-version }} | ||
|
|
||
| - name: Upgrade pip and setuptools | ||
| shell: bash | ||
| run: python -m pip install --upgrade pip setuptools | ||
|
|
||
| - name: Install dependencies | ||
| shell: bash | ||
| run: pip install twine wheel | ||
|
|
||
| - name: Setup deployment | ||
| shell: bash | ||
| run: python setup.py sdist bdist_wheel | ||
|
|
||
| - name: Validate deployment | ||
| shell: bash | ||
| run: twine check dist/* |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - '*' | ||
|
|
||
| jobs: | ||
| release-test: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - uses: ./.github/actions/build-package | ||
|
|
||
| - name: Set up a fresh environment and run tests | ||
| run: | | ||
| python -m venv venv | ||
| source venv/bin/activate | ||
| pip install dist/*.tar.gz | ||
| pip install dist/*.whl | ||
| pip install -e .[test] | ||
| pytest | ||
|
|
||
| release: | ||
| runs-on: ubuntu-22.04 | ||
| needs: release-test | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python 3.8 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: 3.8 | ||
|
|
||
| - name: Compare tags | ||
| run: | | ||
| PKG_VERSION=`grep '__version__' mapbox_tilesets/__init__.py | sed -E "s/^.*['\"](.*)['\"].*$/\1/"` | ||
| echo "Checking that package version [v$PKG_VERSION] matches release tag [${{ github.ref_name }}]" | ||
| [ "${{ github.ref_type }}" = "tag" ] && [ "${{ github.ref_name }}" = "v$PKG_VERSION" ] | ||
|
|
||
| - uses: ./.github/actions/build-package | ||
|
|
||
| - name: Run deployment | ||
| run: | ||
| twine upload dist/* -r pypi -u __token__ -p ${{ secrets.PYPI_PASSWORD }} | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: Unit test | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["**"] | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| test: | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - python-version: 3.8 | ||
| os: ubuntu-22.04 | ||
| - python-version: 3.9 | ||
| os: ubuntu-22.04 | ||
|
|
||
| runs-on: ${{ matrix.os }} | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip setuptools | ||
| pip install "importlib-metadata==4.8.3" | ||
| pip install -r requirements.txt -e .[test] | ||
|
|
||
| - name: Show Python and pytest versions | ||
| run: | | ||
| python --version | ||
| pytest --version | ||
|
|
||
| - name: Run pre-commit checks | ||
| run: pre-commit run --all-files | ||
|
|
||
| - name: Run tests with coverage | ||
| run: pytest --cov --cov-config=.coveragerc --cov-report=xml | ||
|
|
||
| - name: List all files in current directory | ||
| run: ls -la | ||
|
|
||
| - name: Upload coverage to GitHub (optional, internal) | ||
| if: matrix.python-version == '3.8' | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: coverage-report | ||
| path: coverage.xml |
This file was deleted.
Oops, something went wrong.
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.