From 15f0aa08ab275d6f6527c3188690bc9b034e98b5 Mon Sep 17 00:00:00 2001 From: George Joseph Date: Thu, 10 Oct 2024 10:03:34 -0600 Subject: [PATCH] TestVars --- .github/workflows/AsteriskUnitGateTest.yml | 32 ++++++++++++++ .github/workflows/TestWorkflow.yml | 51 +++++++++++----------- 2 files changed, 57 insertions(+), 26 deletions(-) diff --git a/.github/workflows/AsteriskUnitGateTest.yml b/.github/workflows/AsteriskUnitGateTest.yml index 7ffb38e..f572f2f 100644 --- a/.github/workflows/AsteriskUnitGateTest.yml +++ b/.github/workflows/AsteriskUnitGateTest.yml @@ -70,9 +70,41 @@ on: TOKEN: required: true +env: + GH_TOKEN: ${{ secrets.TOKEN }} + GITHUB_TOKEN: ${{ secrets.TOKEN }} + ASTERISK_REPO: ${{ inputs.asterisk_repo }} + BASE_BRANCH: ${{ inputs.base_branch }} + IS_CHERRY_PICK: ${{ inputs.is_cherry_pick }} + PR_NUMBER: ${{ inputs.pr_number }} + CACHE_DIR: ${{ github.workspace }}/${{ inputs.output_cache_dir }} + REPO_DIR: ${{ github.event.repository.name }} + REPO_ORG: ${{ github.event.repository.owner.login }} + OUTPUT_DIR: ${{ github.workspace }}/${{ inputs.output_cache_dir }}/output + ACTIONS_OWNER: ${{ fromJSON(inputs.actions_ref).owner }} + ACTIONS_REPO: ${{ fromJSON(inputs.actions_ref).repo }} + ACTIONS_BRANCH: ${{ fromJSON(inputs.actions_ref).branch }} + SCRIPT_DIR: ${{ github.workspace }}/asterisk-ci-actions/scripts + + + jobs: + Setup: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - name: Setup Runner + run: | + # Setup + wget -qO asterisk-ci-actions.tar.gz \ + https://github.com/${ACTIONS_OWNER}/${ACTIONS_REPO}/archive/refs/heads/${ACTIONS_BRANCH}.tar.gz + tar -xf asterisk-ci-actions.tar.gz --transform="s/^${ACTIONS_REPO}-${ACTIONS_BRANCH}/asterisk-ci-actions/g" + Build: + needs: [ Setup ] uses: ./.github/workflows/AsteriskBuildAndCache.yml with: actions_ref: ${{ inputs.actions_ref }} diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index 3d4074b..dc28a70 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -3,37 +3,36 @@ run-name: "TestWorkflow" on: workflow_dispatch: -jobs: - Build: - uses: ./.github/workflows/AsteriskBuildAndCache.yml - with: - test_type: nightly - asterisk_repo: asterisk/asterisk - pr_number: 931 - base_branch: master - is_cherry_pick: false - build_cache_key: ${{ github.workflow }}-931-master - secrets: - TOKEN: ${{ secrets.GITHUB_TOKEN }} +env: + ACTIONS_OWNER: asterisk + ACTIONS_REPO: asterisk-ci-actions + ACTIONS_BRANCH: main-test-native + SCRIPT_DIR: ${{ github.workspace }}/asterisk-ci-actions/scripts - ShowCache: - needs: [ Build ] +jobs: + Setup: runs-on: ubuntu-latest defaults: run: shell: bash steps: - - name: Setup Runner - uses: asterisk/asterisk-ci-actions/SetupUbuntuRunner@main-test-native + - name: Setup + run: | + # Setup + pwd + wget -qO asterisk-ci-actions.tar.gz \ + https://github.com/${ACTIONS_OWNER}/${ACTIONS_REPO}/archive/refs/heads/${ACTIONS_BRANCH}.tar.gz + tar -xf asterisk-ci-actions.tar.gz --transform="s/^${ACTIONS_REPO}-${ACTIONS_BRANCH}/asterisk-ci-actions/g" + # jq -r '. | from_entries' ${ACTIONS_REPO}/.github/control/asterisk-gh-test.json + sed -i -r -e "s/^vars_/export vars_/g" ${ACTIONS_REPO}/.github/control/asterisk-gh-test.env + source ${ACTIONS_REPO}/.github/control/asterisk-gh-test.env + for VV in ${!vars_@} ; do + echo "$VV=${!VV}" >> "${GITHUB_ENV}" + done - - name: Restore Asterisk Cache - uses: asterisk/asterisk-ci-actions/RestoreAsteriskFromCache@main - with: - repo_dir: asterisk - build_cache_dir: build-cache - build_cache_key: ${{ github.workflow }}-931-master - user_group: asteriskci:users - - name: showcache + - name: Printenv run: | - # Show Cache - find build-cache \ No newline at end of file + printenv + +# - name: DumpEnvironment +# uses: asterisk/asterisk-ci-actions/DumpEnvironmentAction@main