-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GHA release workflow, refactor PR and Daily workflows (#1968)
- Loading branch information
1 parent
ddf179c
commit 2d9053b
Showing
11 changed files
with
461 additions
and
299 deletions.
There are no files selected for viewing
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,32 @@ | ||
name: PyTest Coverage | ||
on: | ||
workflow_call: | ||
inputs: | ||
download-path: | ||
required: true | ||
type: string | ||
jobs: | ||
coverage: | ||
timeout-minutes: 5 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
- name: Setup | ||
run: | | ||
set -ex | ||
python -m pip install --upgrade 'pip<23' wheel | ||
pip install coverage[toml]==6.5.0 | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
path: ${{ inputs.download-path }} | ||
- name: Generate coverage report | ||
run: | | ||
set -ex | ||
# Flatten the coverage files | ||
ls ${{ inputs.download-path }} | while read x; do mv ${{ inputs.download-path }}/$x/.coverage .coverage.$x; done | ||
python -m coverage combine | ||
python -m coverage report |
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
This file was deleted.
Oops, something went wrong.
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,87 @@ | ||
name: Docker Image Configure-Build-Push | ||
on: | ||
workflow_call: | ||
inputs: | ||
build-args: | ||
required: false | ||
type: string | ||
context: | ||
required: true | ||
type: string | ||
image-name: | ||
required: true | ||
type: string | ||
image-uuid: | ||
required: false | ||
type: string | ||
push: | ||
required: true | ||
type: boolean | ||
staging: | ||
required: true | ||
type: boolean | ||
staging-repo: | ||
required: false | ||
type: string | ||
tags: | ||
required: true | ||
type: string | ||
target: | ||
required: false | ||
type: string | ||
secrets: | ||
username: | ||
required: true | ||
password: | ||
required: true | ||
jobs: | ||
configure-build-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.username }} | ||
password: ${{ secrets.password }} | ||
|
||
- name: Calculate Docker Image Variables | ||
run: | | ||
set -euo pipefail | ||
################### | ||
# Calculate the tag | ||
################### | ||
if [ "${{ inputs.staging }}" = "true" ]; then | ||
STAGING_REPO=${{ inputs.staging-repo }} | ||
IMAGE_TAG=${STAGING_REPO}:${{ inputs.image-uuid }} | ||
IMAGE_CACHE="${STAGING_REPO}:${{ inputs.image-name }}-buildcache" | ||
else | ||
IMAGE_TAG=${{ inputs.tags }} | ||
IMAGE_CACHE="${IMAGE_TAG/,*/}-buildcache" | ||
fi | ||
echo "IMAGE_TAG=${IMAGE_TAG}" >> ${GITHUB_ENV} | ||
echo "IMAGE_CACHE=${IMAGE_CACHE}" >> ${GITHUB_ENV} | ||
- name: IMAGE_TAG = ${{ env.IMAGE_TAG }} | ||
run: echo ${{ env.IMAGE_TAG }} | ||
|
||
- name: Build and Push the Docker Image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ${{ inputs.context }} | ||
tags: ${{ env.IMAGE_TAG }} | ||
target: ${{ inputs.target }} | ||
push: ${{ inputs.push }} | ||
cache-from: type=registry,ref=${{ env.IMAGE_CACHE }} | ||
cache-to: type=registry,ref=${{ env.IMAGE_CACHE }},mode=max | ||
build-args: ${{ inputs.build-args }} |
Oops, something went wrong.