Skip to content

Commit

Permalink
Merge branch 'main' into releases/beta-16
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher authored Dec 1, 2023
2 parents b34255d + 5f284db commit 253159e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/e2e-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
if: ${{ startsWith(github.event.pull_request.title, '(release)') }}
outputs:
patient_management_version: ${{steps.versions.outputs.patient_management}}
patient_chart_version: ${{steps.versions.outputs.patient_chart}}
esm_core_version: ${{steps.versions.outputs.esm_core}}
form_builder_version: ${{steps.versions.outputs.form_builder}}
cohort_builder_version: ${{steps.versions.outputs.cohort_builder}}
patient_management_ref: ${{steps.refs.outputs.patient_management}}
patient_chart_ref: ${{steps.refs.outputs.patient_chart}}
esm_core_ref: ${{steps.refs.outputs.esm_core}}
form_builder_ref: ${{steps.refs.outputs.form_builder}}
cohort_builder_ref: ${{steps.refs.outputs.cohort_builder}}

steps:
- uses: actions/checkout@v4
Expand All @@ -24,8 +24,8 @@ jobs:
run: git checkout 'HEAD^{/\(release\)}'

- name: Extract version numbers from the spa-build-config.json file
id: versions
run: sh e2e_test_support_files/extract_tag_numbers.sh
id: refs
run: bash e2e_test_support_files/extract_tag_numbers.sh

- name: Build and Run Containers
run: docker-compose -f e2e_test_support_files/docker-compose-build.yml up -d
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: openmrs/openmrs-esm-patient-management
ref: refs/tags/v${{ needs.build.outputs.patient_management_version }}
ref: ${{ needs.build.outputs.patient_management_ref }}
path: e2e_repo

- name: Copy test environment variables
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: openmrs/openmrs-esm-patient-chart
ref: refs/tags/v${{ needs.build.outputs.patient_chart_version }}
ref: ${{ needs.build.outputs.patient_chart_ref }}
path: e2e_repo

- name: Copy test environment variables
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: openmrs/openmrs-esm-form-builder
ref: refs/tags/v${{ needs.build.outputs.form_builder_version }}
ref: ${{ needs.build.outputs.form_builder_ref }}
path: e2e_repo

- name: Copy test environment variables
Expand Down Expand Up @@ -256,7 +256,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: openmrs/openmrs-esm-core
ref: refs/tags/v${{ needs.build.outputs.esm_core_version }}
ref: ${{ needs.build.outputs.esm_core_ref }}
path: e2e_repo

- name: Copy test environment variables
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: openmrs/openmrs-esm-cohortbuilder
ref: refs/tags/v${{ needs.build.outputs.cohort_builder_version }}
ref: ${{ needs.build.outputs.cohort_builder_ref }}
path: e2e_repo

- name: Copy test environment variables
Expand Down
3 changes: 2 additions & 1 deletion e2e_test_support_files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ component. It then downloads Docker images from a previous "build" job, loads th

The workflow checks out a specific tagged version of the component's repository, the tag is imported from the previous "
build" job. This is necessary because the goal is to perform end-to-end tests on the codebase that corresponds to a
particular release version, rather than the code at the head of the repository.
particular release version, rather than the code at the head of the repository. In case of using pre-releases, it checkouts
to the main branch as we don't create tags for pre-releases.
13 changes: 10 additions & 3 deletions e2e_test_support_files/extract_tag_numbers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ get_repository_tag() {
local file="$1"
local repo_name="$2"
local app="$3"
local value
value=$(awk -F'"' -v app="$app" '$0 ~ app {print $4}' "$file")
echo "$repo_name=$value"

local version=$(awk -F'"' -v app="$app" '$0 ~ app {print $4}' "$file")
local ref="refs/tags/v$version"

# Check if the version number contains "pre" and modify the ref to main branch
if [[ $version == *"pre"* ]]; then
ref="main"
fi

echo "$repo_name=$ref"
}

file_path="frontend/spa-build-config.json"
Expand Down

0 comments on commit 253159e

Please sign in to comment.