-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
163 additions
and
1 deletion.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains 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 @@ | ||
* @Nike-Inc/lab222 |
This file contains 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,30 @@ | ||
--- | ||
name: Check Version | ||
|
||
# Controls when the action will run. | ||
on: | ||
# Triggers the workflow on any PRs to master | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-version: | ||
strategy: | ||
fail-fast: true | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
- name: Check Project version | ||
run: | | ||
git fetch origin master | ||
NEW_VERSION=`git diff origin/master pyproject.toml | grep '^[+]version =' | awk '{gsub(/"/, "", $3); print $3}'` | ||
OLD_VERSION=`git diff origin/master pyproject.toml | grep '^[-]version =' | awk '{gsub(/"/, "", $3); print $3}'` | ||
if [[ $NEW_VERSION == $OLD_VERSION ]]; then | ||
echo "Version in pyproject.toml is not updated" | ||
exit 1 | ||
fi |
This file contains 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,37 @@ | ||
--- | ||
name: Release Docker Image | ||
|
||
# Run when python test runs successfully on master branch | ||
on: | ||
workflow_run: | ||
workflows: ["Python Test"] | ||
branches: ["main"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
docker-build: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Get Package Version | ||
run: echo "VERSION=`cat pyproject.toml | grep '^version =' | awk '{gsub(/"/, "", $3); print $3; exit}'`" >> $GITHUB_ENV | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
platforms: linux/amd64,linux/arm64 | ||
tags: nikelab222/pterradactyl:latest,nikelab222/pterradactyl:${{ env.VERSION }} | ||
- name: Image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
This file contains 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,38 @@ | ||
--- | ||
name: Release Python Package | ||
|
||
# Run when python test runs successfully on master branch | ||
on: | ||
workflow_run: | ||
workflows: ["Python Test"] | ||
branches: ["main"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
python-build: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10"] | ||
poetry-version: [1.4.1] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Run image | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: ${{ matrix.poetry-version }} | ||
- name: Build sdist and wheel | ||
run: poetry build | ||
- name: Publish to public pypi | ||
run: | | ||
poetry config pypi-token.pypi ${PYPI_TOKEN} | ||
poetry publish | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |
This file contains 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,46 @@ | ||
--- | ||
name: Python Test | ||
|
||
on: | ||
# Triggers the workflow on push to master and any PRs to master | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
python-test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10"] | ||
poetry-version: [1.4.1] | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Run image | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: ${{ matrix.poetry-version }} | ||
- name: Install package | ||
run: | | ||
poetry config virtualenvs.create false && poetry install | ||
env: | ||
PIP_DEFAULT_TIMEOUT: "60" | ||
- name: Run Test and generate coverate report | ||
run: poetry run pytest --cov=./ --cov-report=xml | ||
- name: Upload Coverage to CodeCov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: coverage.xml | ||
fail_ci_if_error: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
verbose: true |
This file contains 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