Skip to content

Commit

Permalink
Add formatting of python and groovy
Browse files Browse the repository at this point in the history
  • Loading branch information
funbiscuit committed May 24, 2024
1 parent 4853719 commit 32716c7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Evaluate app version
run: |
echo "APP_VERSION=$(date '+%Y-%m-%d')-$(git rev-parse HEAD | cut -c -6)" >> "$GITHUB_ENV"
- name: Setup Java
uses: actions/setup-java@v3
with:
Expand All @@ -28,7 +32,10 @@ jobs:
run: docker pull funbiscuit/idea-formatter:latest

- name: Build docker image
run: docker build . -t funbiscuit/idea-formatter:latest --cache-from funbiscuit/idea-formatter:latest
run: docker build . -t "funbiscuit/idea-formatter:$APP_VERSION" --cache-from funbiscuit/idea-formatter:latest

- name: Add latest tag
run: docker tag "funbiscuit/idea-formatter:$APP_VERSION" funbiscuit/idea-formatter:latest

- name: Test image
run: docker run --rm -v ${{ github.workspace }}:/data funbiscuit/idea-formatter --style CodeStyle.xml --dry --recursive src
Expand All @@ -41,4 +48,4 @@ jobs:

- name: Push docker image
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: docker push funbiscuit/idea-formatter:latest
run: docker push "funbiscuit/idea-formatter:$APP_VERSION" && docker push funbiscuit/idea-formatter:latest
15 changes: 13 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,27 @@ RUN apt-get update \
&& apt-get install -y unzip wget libfreetype6 fontconfig \
&& rm -rf /var/lib/apt/lists/*

RUN wget https://download.jetbrains.com/idea/ideaIC-2023.1.3.tar.gz \
RUN wget --progress=bar:force https://download.jetbrains.com/idea/ideaIC-2023.1.3.tar.gz \
&& tar -xzf ideaIC-2023.1.3.tar.gz \
&& rm ideaIC-2023.1.3.tar.gz \
&& mv idea-* idea \
&& cd idea \
&& mv plugins plugins-old \
&& mkdir plugins \
&& cp -r plugins-old/java plugins-old/java-ide-customization plugins-old/keymap-* plugins \
&& cp -r plugins-old/java \
plugins-old/java-ide-customization \
plugins-old/keymap-* \
plugins-old/properties \
plugins-old/Groovy \
plugins \
&& rm -r plugins-old

# PythonCore 231.8770.65
RUN wget --progress=bar:force -O python-ce.zip "https://plugins.jetbrains.com/plugin/download?rel=true&updateId=326457" \
&& unzip python-ce.zip \
&& rm python-ce.zip \
&& mv python-ce idea/plugins/python-ce

WORKDIR /app/idea

COPY build/distributions/formatter-plugin plugins/formatter-plugin
Expand Down

0 comments on commit 32716c7

Please sign in to comment.