Skip to content

Commit

Permalink
testing output variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Do committed Feb 7, 2024
1 parent 459db52 commit b801fd6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/templates/docker_context/docker_context.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ done <<< "$modules"

# Convert the array of JSON objects to a single JSON array
json_services=$(jq -nc '[( $ARGS.positional[] | fromjson )]' --args -- ${json_objects[*]})
echo "docker_matrix=$(echo $json_services | jq -c '{include: .}')" >> #$GITHUB_OUTPUT
echo "docker_matrix=$(echo $json_services | jq -c '{include: .}')" >> $GITHUB_OUTPUT

################# Setup Docker Registry and Repository Name #################
# Docker Registry to pull/push images
Expand Down
74 changes: 37 additions & 37 deletions .github/workflows/temp_ci_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Get changed files

outputs:
modified_modules: ${{ steps.report-changes.outputs.CHANGED_MODULES }}
modified_modules: ${{ steps.report-changes.outputs.testvar }}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -101,45 +101,45 @@ jobs:
modified_modules: ${{ env.CHANGED_MODULES }}
run: |
echo "CHANGED_MODULES: ${{ env.CHANGED_MODULES }}"
echo "CHANGED_MODULES=$CHANGED_MODULES" >> $GITHUB_ENV
echo "testvar=$CHANGED_MODULES" >> $GITHUB_ENV
- name: Sanity check
run: |
echo 1 ${{ steps.report-changes.outputs.CHANGED_MODULES }}
echo 1 ${{ steps.world_modeling.outputs.CHANGED_MODULES }}
echo 2 ${{ env.CHANGED_MODULES }}
setup-environment:
name: Setup environment
runs-on: ubuntu-latest
needs: get_changed_modules

env:
modified_modules: ${{ needs.get_changed_modules.outputs.modified_modules }}

outputs:
docker_matrix: ${{ steps.docker-environment.outputs.docker_matrix }}
registry: ${{ steps.docker-environment.outputs.registry }}
repository: ${{ steps.docker-environment.outputs.repository }}
source_branch: ${{ steps.github-environment.outputs.source_branch }}
target_branch: ${{ steps.github-environment.outputs.target_branch }}

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Watod Environment
run: ./watod_scripts/watod-setup-env.sh
shell: bash

- name: Check module changes
run: echo "changed is ${{ env.modified_modules }}"

- name: Generate Docker Environment
id: docker-environment
uses: "./.github/templates/docker_context"
with:
modified_modules: ${{ env.modified_modules }}
- name: Generate GitHub Environment
id: github-environment
uses: "./.github/templates/github_context"
name: Setup environment
runs-on: ubuntu-latest
needs: get_changed_modules

env:
modified_modules: ${{ needs.get_changed_modules.outputs.modified_modules }}

outputs:
docker_matrix: ${{ steps.docker-environment.outputs.docker_matrix }}
registry: ${{ steps.docker-environment.outputs.registry }}
repository: ${{ steps.docker-environment.outputs.repository }}
source_branch: ${{ steps.github-environment.outputs.source_branch }}
target_branch: ${{ steps.github-environment.outputs.target_branch }}

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup Watod Environment
run: ./watod_scripts/watod-setup-env.sh
shell: bash

- name: Check module changes
run: echo "changed is ${{ env.modified_modules }}"

- name: Generate Docker Environment
id: docker-environment
uses: "./.github/templates/docker_context"
with:
modified_modules: ${{ env.modified_modules }}

- name: Generate GitHub Environment
id: github-environment
uses: "./.github/templates/github_context"
2 changes: 1 addition & 1 deletion src/action/test.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3
1
2 changes: 1 addition & 1 deletion src/interfacing/test2.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9
1

0 comments on commit b801fd6

Please sign in to comment.