fix: uppercase AS in Dockerfile. #633
This file contains hidden or 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: Build, Test and Deploy GumTree | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- 'v*' | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: '59 23 * * SUN' | |
workflow_dispatch: | |
concurrency: | |
group: "build-${{ github.head_ref || github.ref }}" | |
cancel-in-progress: true | |
jobs: | |
build-test-deploy: | |
runs-on: ubuntu-24.04 | |
environment: MavenCentral | |
if: ${{ !(contains(github.event.head_commit.message, '[no ci]') || startsWith(github.event.head_commit.message, 'doc')) }} | |
steps: | |
- name: checkout gumtree | |
uses: actions/checkout@v5 | |
with: | |
submodules: recursive | |
show-progress: '' | |
- name: retrieve gumtree version | |
id: version | |
run: echo "VERSION=$(cat build.gradle | grep "projectsVersion =" | cut -f 2 -d "'")" >> $GITHUB_OUTPUT | |
shell: bash | |
- uses: actions/setup-python@v6 | |
with: | |
cache: 'pip' | |
- run: pip install pandas plotnine scipy jupyter | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v4 | |
- name: build gumtree and run benchmarks | |
run: ./gradlew build :benchmark:runOnDefects4J :benchmark:runOnGhJava :benchmark:execNotebook | |
- name: upload benchmarks results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: benchmark-report | |
path: benchmark/build/reports/analysis.html | |
- name: upload snapshot package | |
env: | |
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }} | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }} | |
if: ${{ github.event_name == 'schedule' && contains(steps.version.outputs.VERSION, 'SNAPSHOT') }} | |
run: ./gradlew publish | |
- name: upload release package | |
if: ${{ github.event_name == 'push' && !contains(steps.version.outputs.VERSION, 'SNAPSHOT') && endsWith(github.ref, steps.version.outputs.VERSION) }} | |
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | |
env: | |
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEUSERNAME }} | |
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPEPASSWORD }} | |
ORG_GRADLE_PROJECT_gumtreeKey: ${{ secrets.GUMTREE_KEY }} | |
ORG_GRADLE_PROJECT_gumtreeKeyPassphrase: ${{ secrets.GUMTREE_KEY_PASSPHRASE }} | |
- name: create github release | |
if: ${{ github.event_name == 'push' && !contains(steps.version.outputs.VERSION, 'SNAPSHOT') && endsWith(github.ref, steps.version.outputs.VERSION) }} | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "dist-minimal/build/distributions/gumtree*.zip" | |
bodyFile: "CHANGELOG.md" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
docker: | |
runs-on: ubuntu-24.04 | |
needs: build-test-deploy | |
if: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && !(contains(github.event.head_commit.message, '[no ci]') || startsWith(github.event.head_commit.message, 'doc')) }} | |
steps: | |
- name: set up docker buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx | |
- name: set docker image tag | |
id: set-tag | |
run: | | |
if [[ $GITHUB_REF == refs/tags/v* ]]; then | |
echo "IMAGE_TAG=$(echo $GITHUB_REF | sed 's/refs\/tags\///')" >> $GITHUB_ENV | |
else | |
echo "IMAGE_TAG=latest" >> $GITHUB_ENV | |
fi | |
- name: check secrets presence | |
id: checksecrets | |
shell: bash | |
run: | | |
if [ "$SECRET" == "" ]; then | |
echo "secretspresent=false" >> $GITHUB_OUTPUT | |
else | |
echo "secretspresent=true" >> $GITHUB_OUTPUT | |
fi | |
env: | |
SECRET: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: login to Docker Hub | |
uses: docker/login-action@v3 | |
if: (steps.checksecrets.outputs.secretspresent == 'true') | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: build and push docker image | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
file: 'docker/Dockerfile' | |
push: ${{ steps.checksecrets.outputs.secretspresent }} | |
tags: gumtreediff/gumtree:${{ env.IMAGE_TAG }} |