Skip to content

Increase dependency versions. Support 242.* #78

Increase dependency versions. Support 242.*

Increase dependency versions. Support 242.* #78

Workflow file for this run

name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
outputs:
version: ${{ steps.properties.outputs.version }}
changelog: ${{ steps.properties.outputs.changelog }}
steps:
# Free GitHub Actions Environment Disk Space
- name: Maximize Build Space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
- name: Check out
uses: actions/checkout@v3
- name: Download Lama Cache
uses: actions/cache@v3
id: opam-cache
with:
path: |
~/.opam
~/opam_cache.tar.xz
key: ${{ runner.os }}-opam-cache
- name: Install Lima
shell: bash
if: ${{ matrix.os == 'macos-latest' }}
run: |
brew install lima
limactl start
- name: Lima Alias
shell: bash
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
mkdir ~/.lima
touch ~/.lima/lima
echo '#!/bin/bash' >> ~/.lima/lima
echo 'bash "$2"' >> ~/.lima/lima
chmod +x ~/.lima/lima
echo "$HOME/.lima" >> $GITHUB_PATH
- name: Copy Lama Cache to Lima
shell: bash
if: ${{ matrix.os == 'macos-latest' && steps.opam-cache.outputs.cache-hit == 'true' }}
run: |
limactl copy ~/opam_cache.tar.xz default:~/opam_cache.tar.xz
- name: Unpack Lama Cache
shell: lima bash {0}
if: ${{ matrix.os == 'macos-latest' && steps.opam-cache.outputs.cache-hit == 'true' }}
run: |
sudo apt update -y
sudo apt install bzip2 -y
echo "Unpacking..."
sudo tar -xf ~/opam_cache.tar.xz -C ~
ls -al ~
- name: Install Lama
shell: lima bash {0}
run: |
sudo add-apt-repository ppa:avsm/ppa -y
sudo apt update -y
sudo apt install build-essential -y
sudo apt install gcc-multilib -y
sudo apt install opam -y
sudo apt install bzip2 -y
opam init -y
opam switch create lama ocaml-variants.4.11.2+fp+flambda
eval $(opam env --switch=lama)
opam pin add Lama 'https://github.com/JetBrains-Research/Lama.git#1.10' --no-action -y
opam install opam-depext -y
opam depext Lama --yes
opam install Lama --yes
which lamac
- name: Pack Lama Cache
shell: lima bash {0}
if: ${{ matrix.os == 'macos-latest' && steps.opam-cache.outputs.cache-hit != 'true' }}
run: |
sudo tar -cjf ~/opam_cache.tar.xz -C ~ .opam
- name: Copy Cache from Lima
shell: bash
if: ${{ matrix.os == 'macos-latest' && steps.opam-cache.outputs.cache-hit != 'true' }}
run: |
limactl copy default:~/opam_cache.tar.xz ~/opam_cache.tar.xz
- name: Gradle Wrapper Validation
uses: gradle/[email protected]
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: liberica
java-version: 17
cache: gradle
- name: Export Properties
id: properties
shell: bash
run: |
PROPERTIES="$(./gradlew properties --console=plain -q)"
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
CHANGELOG="$(./gradlew getChangelog --unreleased --no-header --console=plain -q)"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "name=$NAME" >> $GITHUB_OUTPUT
echo "pluginVerifierHomeDir=~/.pluginVerifier" >> $GITHUB_OUTPUT
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
- name: Run Tests
run: ./gradlew test
- name: Collect Tests Result
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: tests-result
path: ${{ github.workspace }}/build/reports/tests
- name: Setup Plugin Verifier IDEs Cache
uses: actions/cache@v3
with:
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
- name: Run Plugin Verification tasks
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
- name: Collect Plugin Verifier Result
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: pluginVerifier-result
path: ${{ github.workspace }}/build/reports/pluginVerifier
# - name: Qodana - Code Inspection
# if: ${{ matrix.os == 'ubuntu-latest' }}
# uses: JetBrains/[email protected]
- name: Prepare Plugin Artifact
id: artifact
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
run: |
cd ${{ github.workspace }}/build/distributions
FILENAME=`ls *.zip`
unzip "$FILENAME" -d content
echo "filename=${FILENAME:0:-4}" >> $GITHUB_OUTPUT
- name: Upload artifact
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v3
with:
name: ${{ steps.artifact.outputs.filename }}
path: ./build/distributions/content/*/*
releaseDraft:
name: Release Draft
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Remove Old Release Drafts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh api repos/{owner}/{repo}/releases \
--jq '.[] | select(.draft == true) | .id' \
| xargs -I '{}' gh api -X DELETE repos/{owner}/{repo}/releases/{}
- name: Create Release Draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create v${{ needs.build.outputs.version }} \
--draft \
--title "v${{ needs.build.outputs.version }}" \
--notes "$(cat << 'EOM'
${{ needs.build.outputs.changelog }}
EOM
)"