Pull image only once. #2
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
name: Reusable Workflow | |
on: | |
workflow_call: | |
inputs: | |
python-version: | |
required: false | |
type: string | |
default: '3.12' | |
mm-type: | |
required: true | |
type: string | |
mm-branch: | |
required: false | |
type: string | |
default: 'master' | |
mm-auth: | |
required: false | |
type: string | |
default: '' | |
rtppc-type: | |
required: true | |
type: string | |
artifact-files: | |
required: false | |
type: string | |
default: '' | |
secrets: | |
required: | |
- PYPI_USERNAME | |
- PYPI_PASSWORD | |
jobs: | |
job: | |
runs-on: ubuntu-latest | |
env: | |
MM_TYPE: ${{ input.mm-type }} | |
MM_BRANCH: ${{ input.mm-branch }} | |
RTPP_BRANCH: DOCKER | |
RTPPC_TYPE: ${{ input.rtppc-type }} | |
PYTHON_CMD: "python${{ input.python-version }}" | |
steps: | |
- name: Download saved Docker image | |
uses: actions/download-artifact@v4 | |
with: | |
name: rtpproxy_latest_ubuntu_latest | |
path: rtpproxy_latest_ubuntu_latest.tar | |
- name: Load Docker image | |
run: docker load -i rtpproxy_latest_ubuntu_latest.tar | |
- name: Set up container environment | |
run: docker run --privileged -d --name rtpproxy_container sippylabs/rtpproxy:latest-ubuntu_latest | |
- name: Set up Python ${{ inputs.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ inputs.python-version }} | |
- name: before_install | |
run: sh -x cibits/before_install.sh | |
- name: transform_var | |
id: transform_var | |
run: | | |
ARTNAME="test-logs_${{ inputs.mm-type }}_${{ inputs.mm-branch }}_${{ inputs.rtppc-type }}" | |
MM_AUTH="`echo "${{ inputs.mm-auth }}" | sed 's|/|.|g'`" | |
if [ "${MM_AUTH}" != "" ] | |
then | |
ARTNAME="${ARTNAME}_${MM_AUTH}" | |
echo "MM_AUTH=${{ inputs.mm-auth }}" >> $GITHUB_ENV | |
fi | |
echo "ARTNAME=${ARTNAME}" >> $GITHUB_OUTPUT | |
- name: script | |
run: sh -x ./test_run.sh | |
- name: Test logs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.transform_var.outputs.ARTNAME }} | |
path: | | |
bob.log | |
alice.log | |
rtpproxy.log | |
${{ inputs.artifact-files }} | |
continue-on-error: true |