Skip to content

Respect order when --codemod-includes are set (#464) #161

Respect order when --codemod-includes are set (#464)

Respect order when --codemod-includes are set (#464) #161

# After each commit to main, this action will be triggered in order to build and push the images into the public registry.
# the images from the public registry will be pulled and used during the execution of the integration test locally
name: Release integration test framework
on:
push:
branches:
- 'main'
env:
TEST_FRAMEWORK_PATH: core-codemods/src/test/java/io/codemodder/codemods/integration
jobs:
upload-images:
name: Upload images to Dockerhub
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Java
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0 # v3.13.0
with:
distribution: 'temurin'
java-version: '17'
# tar file generation, tar file contains codemodder executable file to be used in the codemodder-base image
- name: Generate distribution
uses: gradle/gradle-build-action@842c587ad8aa4c68eeba24c396e15af4c2e9f30a # v2.9.0
with:
arguments: core-codemods:distTar
- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
with:
driver: docker
- name: Build codemodder base image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: .
file: ${{ env.TEST_FRAMEWORK_PATH }}/baseimage/Dockerfile
push: true
tags: codemodder/codemodder-base:latest
# defining the list of test projects for which an image will be generated
- name: Setup test project names
run: |
TEST_PROJECT_NAMES=$(./gradlew core-codemods:getTestProjectNames -q)
echo "TEST_PROJECT_NAMES<<EOF">> $GITHUB_ENV
echo $TEST_PROJECT_NAMES >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Build test projects images
run: |
for TEST_PROJECT_NAME in ${{ env.TEST_PROJECT_NAMES }}; do
docker build \
-f ${{ env.TEST_FRAMEWORK_PATH }}/projectimage/Dockerfile \
--build-arg CODEMODDER_BASE_IMAGE=codemodder/codemodder-base \
--build-arg CODEMOD_ID=${TEST_PROJECT_NAME} \
-t codemodder/${TEST_PROJECT_NAME}:latest \
.
docker push codemodder/${TEST_PROJECT_NAME}:latest
done