Skip to content
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

Update workflows to run on GitHub #328

Merged
merged 62 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from 45 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
6e07de6
commit inital changes
wbarnha Feb 22, 2023
10e1052
add setuptools_scm
wbarnha Feb 22, 2023
b50a628
Revert "add setuptools_scm"
wbarnha Feb 22, 2023
bd9aff7
add more updates
wbarnha Feb 22, 2023
1b132c8
remove all references to loop=loop
wbarnha Feb 22, 2023
e532509
revert change
wbarnha Feb 22, 2023
3b88964
revert changes
wbarnha Feb 22, 2023
d896c0a
revert changes
wbarnha Feb 22, 2023
82cb4a8
fix all_tasks call
wbarnha Feb 23, 2023
a5790dd
add dist.yaml
wbarnha Feb 23, 2023
a5f4736
add gh-pages.yml
wbarnha Feb 23, 2023
972952f
always deploy docs for now
wbarnha Feb 23, 2023
51d92b0
bump notes for 0.4.6
wbarnha Feb 23, 2023
0891791
freeze versions in requirements-dev.txt
wbarnha Feb 23, 2023
effe33b
Merge branch 'revive-cicd'
wbarnha Feb 23, 2023
371d36b
eol py3.7
wbarnha Feb 23, 2023
dc85438
Merge branch 'revive-cicd'
wbarnha Feb 23, 2023
93eea6a
experiment with caching
wbarnha Feb 23, 2023
509bae4
change rules
wbarnha Feb 23, 2023
5050099
experiment with new flow
wbarnha Feb 23, 2023
9ae510b
rename main to master
wbarnha Feb 23, 2023
bc31f2c
replace needs:check with needs:tests
wbarnha Feb 23, 2023
5b1784d
rename environ_config to aiiomoitor
wbarnha Feb 23, 2023
044876b
use setuptools_scm and importlib for automatic versioning
wbarnha Feb 23, 2023
cda3d3d
disable py3.7
wbarnha Feb 23, 2023
96e16ef
disable nox usage
wbarnha Feb 23, 2023
7b8285b
fix setup.py flaking
wbarnha Feb 23, 2023
5c434ad
fix doc build
wbarnha Feb 23, 2023
6745629
disable 3.12 tests
wbarnha Feb 23, 2023
94b6e68
rename refernces from aiomysql to aiomontior
wbarnha Apr 16, 2023
df5fe80
cleanup
wbarnha Apr 16, 2023
1065730
update ci-cd.yml
wbarnha Apr 16, 2023
5feaf83
partial revert
wbarnha Apr 16, 2023
496ca64
Add check
wbarnha Apr 16, 2023
9a20704
remove SQL refs
wbarnha Apr 17, 2023
b181f5d
Update .github/workflows/ci-cd.yml
wbarnha Apr 17, 2023
dbf1869
remove issue_templates
wbarnha Apr 18, 2023
742b0d2
use codecov
wbarnha Apr 18, 2023
f85db30
reorg
wbarnha Apr 18, 2023
524b5b7
add names
wbarnha Apr 18, 2023
464914a
add forgotten fetch-depth
wbarnha Apr 18, 2023
0c91411
change checkout-sdist
wbarnha Apr 18, 2023
3cd4506
get required dependencies for testing
wbarnha Apr 18, 2023
9f5c4f5
address change with depth:0
wbarnha Apr 18, 2023
e0b5402
add environment:pypi
wbarnha Apr 18, 2023
0fa33c7
Merge branch 'master' into update-workflows
achimnol Apr 24, 2023
86d292d
ci: Merge the contents of ci-cd.yml and default.yml
achimnol Apr 24, 2023
c235552
ci: Fix the needs list
achimnol Apr 24, 2023
4ac71bc
fix: Rename gh-page.yml to docs.yml and fix typo
achimnol Apr 24, 2023
0f3952a
fix: Remove duplicate step names
achimnol Apr 24, 2023
369145e
ci: Use the ghactions doc way of marking experimental tests
achimnol Apr 24, 2023
0b158e7
ci: Fix renaming job steps
achimnol Apr 24, 2023
d2ecaa1
ci: Relax the dependabot check interval to one month
achimnol Apr 24, 2023
7d00298
ci: Let docs workflow install only required stuffs
achimnol Apr 24, 2023
13f58de
ci: Fix the docs workflow
achimnol Apr 24, 2023
a2fcf69
Instruct git to render .git_archival.txt
achimnol Apr 24, 2023
f9bff01
ci: Run build-sdist first
achimnol Apr 25, 2023
e1f8e02
ci: Rename default.yml to ci-cd.yml
achimnol Apr 25, 2023
93c19f0
ci: Let it run sdist-build always and remove "-I" on pip invocation
achimnol Apr 25, 2023
de09c69
fix: Make type-anno compatible with Python 3.8
achimnol Apr 25, 2023
85cf3ed
fix: Make type anno compatible with Python 3.8
achimnol Apr 25, 2023
a481650
Merge branch 'master' into update-workflows
achimnol Apr 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think daily update may be too frequent.
How about once for two weeks?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately dependabot configuration only allows "daily", "weekly" or "monthly".
I'm going to set it "monthly", to prevent spamming.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
target-branch: master
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
open-pull-requests-limit: 10
120 changes: 120 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
---
name: CI/CD

on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

env:
FORCE_COLOR: "1" # Make tools pretty.
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PIP_NO_PYTHON_VERSION_WARNING: "1"
PYTHON_LATEST: "3.11"

# For re-actors/checkout-python-sdist
sdist-artifact: python-package-distributions

permissions:
contents: read

jobs:
build-sdist:
name: 📦 Build the source distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
wbarnha marked this conversation as resolved.
Show resolved Hide resolved
name: Checkout project
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Setup ${{ env.PYTHON_LATEST }}
with:
python-version: ${{ env.PYTHON_LATEST }}
- run: python -Im pip install build
achimnol marked this conversation as resolved.
Show resolved Hide resolved
name: Install core libraries for build and install

- run: python -Im build
name: Build artifacts

- uses: actions/upload-artifact@v3
name: Upload built artifacts for testing
with:
name: ${{ env.sdist-artifact }}
# NOTE: Exact expected file names are specified here
# NOTE: as a safety measure — if anything weird ends
# NOTE: up being in this dir or not all dists will be
# NOTE: produced, this will fail the workflow.
path: dist/${{ env.sdist-name }}
retention-days: 15

tests:
name: Tests on ${{ matrix.python-version }}
needs: build-sdist
runs-on: ubuntu-latest

strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
wbarnha marked this conversation as resolved.
Show resolved Hide resolved
- "~3.12.0-0"
continue-on-error: >-
${{ contains(matrix.python-version, '~') && true || false }}
steps:
- name: Get source code from pre-built sdist
uses: re-actors/checkout-python-sdist@release/v1
with:
workflow-artifact-name: ${{ env.sdist-artifact }}
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v3
name: Checkout project to get necessary dependencies for testing
with:
fetch-depth: 0
- name: Install dependencies
run: |
pip install --upgrade setuptools
pip install -r requirements-dev.txt
wbarnha marked this conversation as resolved.
Show resolved Hide resolved
- name: Run tests
run: make test

- name: Upload coverage data
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}


check: # This job does nothing and is only used for the branch protection
if: always()
needs: tests
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

deploy: # Run only on creating release for new tag
name: Deploy
runs-on: ubuntu-latest
needs: check
environment: pypi
if: github.event_name == 'release' && github.event.action == 'created'
wbarnha marked this conversation as resolved.
Show resolved Hide resolved
steps:
- uses: actions/download-artifact@v3
name: Download artifacts
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@release/v1
name: Publish package to PyPI
with:
password: ${{ secrets.PYPI_API_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Pages

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
release:
types: [created]
branches:
- 'master'

jobs:
build:
name: "Build docs"
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v4
- uses: actions/checkout@v3
with:
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo
- name: "Install runtime dependencies"
run: >
pip install -r requirements-dev.txt
pip install -r requirements-doc.txt
pip install -e .
- name: "Install doc build deps and build with Sphinx"
run: make doc
- name: "Upload artifacts"
uses: actions/upload-pages-artifact@v1
with:
# Upload built docs
path: "./docs/_build/html/"
deploy:
name: "Deploy docs"
needs: build
runs-on: ubuntu-latest
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/deploy-pages@v1
id: deployment
name: "Deploy to GitHub Pages"