-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Transition CI/CD to GitHub Workflows #2378
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
Changes from 28 commits
98e427c
e2acd92
77c345b
bd1b0fe
4a62b02
4f03240
57c523c
5ddacca
75a9ef7
21a36f8
9759af4
fa4b11a
d05e798
60ad460
ddd2c0d
2b600c7
4d1077c
1f6ce72
4ec8f04
ea2e8a0
24ce096
1a13bae
873bc2d
c895bba
f186ae1
674ab78
5a0a662
6baa9d7
abf7706
4d05fd9
4ef5dbc
f43e002
b8e9e51
30bfa8c
7fc76d1
63837d6
9ef7d62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Code of Conduct | ||
|
||
Everyone interacting in the project's codebases, issue trackers, chat rooms, | ||
and mailing lists is expected to follow the Faust Code of Conduct. | ||
|
||
As contributors and maintainers of these projects, and in the interest of fostering | ||
an open and welcoming community, we pledge to respect all people who contribute | ||
through reporting issues, posting feature requests, updating documentation, | ||
submitting pull requests or patches, and other activities. | ||
|
||
We are committed to making participation in these projects a harassment-free | ||
experience for everyone, regardless of level of experience, gender, | ||
gender identity and expression, sexual orientation, disability, | ||
personal appearance, body size, race, ethnicity, age, | ||
religion, or nationality. | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery | ||
* Personal attacks | ||
* Trolling or insulting/derogatory comments | ||
* Public or private harassment | ||
* Publishing other's private information, such as physical | ||
or electronic addresses, without explicit permission | ||
* Other unethical or unprofessional conduct. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject | ||
comments, commits, code, wiki edits, issues, and other contributions that are | ||
not aligned to this Code of Conduct. By adopting this Code of Conduct, | ||
project maintainers commit themselves to fairly and consistently applying | ||
these principles to every aspect of managing this project. Project maintainers | ||
who do not follow or enforce the Code of Conduct may be permanently removed from | ||
the project team. | ||
|
||
This code of conduct applies both within project spaces and in public spaces | ||
when an individual is representing the project or its community. | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported by opening an issue or contacting one or more of the project maintainers. | ||
|
||
This Code of Conduct is adapted from the Contributor Covenant, | ||
version 1.2.0 available at http://contributor-covenant.org/version/1/2/0/. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
|
||
# Maintain dependencies for pip | ||
- package-ecosystem: "pip" | ||
directory: "/requirements" | ||
schedule: | ||
interval: "daily" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: CodeQL | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not critical to include this, but it has served me well in other projects. |
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [master] | ||
schedule: | ||
- cron: 19 10 * * 6 | ||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [python] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] | ||
# Learn more: | ||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
release: | ||
types: [created] | ||
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" | ||
KAFKA_LATEST: "2.6.0" | ||
|
||
# For re-actors/checkout-python-sdist | ||
sdist-artifact: python-package-distributions | ||
|
||
jobs: | ||
|
||
build-sdist: | ||
name: 📦 Build the source distribution | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_LATEST }} | ||
cache: pip | ||
- run: python -m pip install build | ||
name: Install core libraries for build and install | ||
- name: Build artifacts | ||
run: python -m build | ||
- name: Upload built artifacts for testing | ||
uses: actions/upload-artifact@v3 | ||
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 | ||
|
||
test-python: | ||
name: Tests on ${{ matrix.python-version }} | ||
needs: | ||
- build-sdist | ||
runs-on: ubuntu-latest | ||
continue-on-error: ${{ matrix.experimental }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "pypy3.9" | ||
experimental: [ false ] | ||
# include: | ||
# - python-version: "~3.12.0-0" | ||
# experimental: true | ||
steps: | ||
- name: Checkout the source code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 11 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: pip | ||
cache-dependency-path: | | ||
requirements-dev.txt | ||
- name: Check Java installation | ||
run: source travis_java_install.sh | ||
- name: Pull Kafka releases | ||
run: ./build_integration.sh | ||
env: | ||
PLATFORM: ${{ matrix.platform }} | ||
KAFKA_VERSION: ${{ env.KAFKA_LATEST }} | ||
# TODO: Cache releases to expedite testing | ||
- name: Install dependencies | ||
run: | | ||
sudo apt install -y libsnappy-dev libzstd-dev | ||
python -m pip install --upgrade pip | ||
python -m pip install tox tox-gh-actions | ||
pip install . | ||
pip install -r requirements-dev.txt | ||
- name: Test with tox | ||
run: tox | ||
env: | ||
PLATFORM: ${{ matrix.platform }} | ||
KAFKA_VERSION: ${{ env.KAFKA_LATEST }} | ||
|
||
test-kafka: | ||
name: Tests for Kafka ${{ matrix.kafka-version }} | ||
needs: | ||
- build-sdist | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
kafka-version: | ||
- "0.8.2.2" | ||
- "0.9.0.1" | ||
- "0.10.2.2" | ||
- "0.11.0.2" | ||
- "0.11.0.3" | ||
- "1.1.1" | ||
- "2.4.0" | ||
- "2.5.0" | ||
- "2.6.0" | ||
Comment on lines
+121
to
+129
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be nice to keep all of these versions in a file somewhere for convenience, so we don't need to edit supported Kafka versions in multiple places. |
||
steps: | ||
- name: Checkout the source code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 8 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ env.PYTHON_LATEST }} | ||
cache: pip | ||
cache-dependency-path: | | ||
requirements-dev.txt | ||
- name: Pull Kafka releases | ||
run: ./build_integration.sh | ||
env: | ||
# This is fast enough as long as you pull only one release at a time, | ||
# no need to worry about caching | ||
PLATFORM: ${{ matrix.platform }} | ||
KAFKA_VERSION: ${{ matrix.kafka-version }} | ||
- name: Install dependencies | ||
run: | | ||
sudo apt install -y libsnappy-dev libzstd-dev | ||
python -m pip install --upgrade pip | ||
python -m pip install tox tox-gh-actions | ||
pip install . | ||
pip install -r requirements-dev.txt | ||
- name: Test with tox | ||
run: tox | ||
env: | ||
PLATFORM: ${{ matrix.platform }} | ||
KAFKA_VERSION: ${{ matrix.kafka-version }} | ||
|
||
check: # This job does nothing and is only used for the branch protection | ||
name: ✅ Ensure the required checks passing | ||
if: always() | ||
needs: | ||
- build-sdist | ||
- test-python | ||
- test-kafka | ||
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) }} | ||
|
||
publish: # Run only on creating release for new tag | ||
name: 📦 Publish to PyPI | ||
runs-on: ubuntu-latest | ||
needs: check | ||
permissions: | ||
id-token: write | ||
environment: pypi | ||
if: github.event_name == 'release' && github.event.action == 'created' | ||
steps: | ||
- name: Download the sdist artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ env.sdist-artifact }} | ||
path: dist | ||
- name: Publish package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
wbarnha marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.