Skip to content

Rollback submodule to enable syncing #1676

Rollback submodule to enable syncing

Rollback submodule to enable syncing #1676

Workflow file for this run

name: ELP CI
on:
push: {}
pull_request:
branches:
- main
release:
types: [published]
jobs:
edb:
runs-on: ubuntu-latest
steps:
- name: Checkout erlang-language-platform
uses: "actions/checkout@v3"
- id: setup-erlang
uses: ./.github/actions/setup-erlang
with:
os: linux
otp-version: 27.3
brew-otp-version: 27
- id: build-edb
uses: ./.github/actions/build-edb
with:
os: ${{ matrix.os }}
target: ${{ matrix.target }}
otp-version: ${{ matrix.otp-version}}
ci:
strategy:
fail-fast: false
matrix:
platform-arch: [ubuntu-22.04-x64, ubuntu-22.04-arm, macos-13-x64, macos-latest-arm, windows-2022-x64]
otp-version: [26.2, 27.3, 28.0]
include:
- otp-version: 26.2
brew-otp-version: 26
vscode-publish: true
choco-otp-version: 26.2.5.13
- otp-version: 27.3
brew-otp-version: 27
vscode-publish: false
choco-otp-version: 27.3.4
- otp-version: 28.0
brew-otp-version: 28
vscode-publish: false
choco-otp-version: 28.0.1
- platform-arch: ubuntu-22.04-x64
platform: ubuntu-22.04
os: linux
target: x86_64-unknown-linux-gnu
vscode-target: linux-x64
- platform-arch: ubuntu-22.04-arm
platform: ubuntu-22.04-arm
os: linux
target: aarch64-unknown-linux-gnu
vscode-target: linux-arm64
- platform-arch: macos-13-x64
platform: macos-13
os: macos
target: x86_64-apple-darwin
vscode-target: darwin-x64
- platform-arch: macos-latest-arm
platform: macos-latest
os: macos
target: aarch64-apple-darwin
vscode-target: darwin-arm64
- platform-arch: windows-2022-x64
platform: windows-2022
os: windows
target: x86_64-pc-windows-msvc
vscode-target: win32-x64
runs-on: ${{ matrix.platform }}
needs: edb
steps:
- name: Checkout erlang-language-platform
uses: "actions/checkout@v3"
with:
submodules: true
- name: Set up GraalVM
uses: graalvm/setup-graalvm@v1
with:
java-version: '17'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up SBT
uses: olafurpg/setup-scala@v14
with:
java-version: '17'
- name: Set up rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
components: rustfmt
- name: Set up cross-compiler
if: matrix.platform-arch == 'ubuntu-22.04-arm'
run: |
sudo apt-get update
sudo apt-get install -y crossbuild-essential-arm64
- id: setup-erlang
uses: ./.github/actions/setup-erlang
with:
os: ${{ matrix.os }}
otp-version: ${{ matrix.otp-version }}
brew-otp-version: ${{ matrix.brew-otp-version}}
- name: Assemble eqwalizer.jar (No Windows)
if: matrix.os != 'windows'
working-directory: eqwalizer/eqwalizer
run: "sbt assembly"
- name: Assemble eqwalizer.jar (Windows Only)
if: matrix.os == 'windows'
working-directory: eqwalizer\eqwalizer
run: "sbt assembly"
shell: bash
- name: Assemble eqwalizer binary (No Windows)
if: matrix.os != 'windows'
working-directory: eqwalizer/eqwalizer
run: 'native-image -H:IncludeResources=application.conf --no-server --no-fallback -jar target/scala-3.6.4/eqwalizer.jar eqwalizer'
- name: Assemble eqwalizer binary (Windows Only)
if: matrix.os == 'windows'
working-directory: eqwalizer\eqwalizer
run: 'native-image -H:IncludeResources=application.conf --no-server --no-fallback -jar target\scala-3.6.4\eqwalizer.jar eqwalizer'
- name: Ensure elp is formatted
run: 'cargo fmt -- --check'
- name: Configure Environment (No Windows)
if: matrix.os != 'windows'
run: |
echo "EQWALIZER_DIR=${{ github.workspace }}/eqwalizer/eqwalizer" >> $GITHUB_ENV
echo "ELP_EQWALIZER_PATH=${{ github.workspace }}/eqwalizer/eqwalizer/eqwalizer" >> $GITHUB_ENV
- name: Configure Environment (Windows Only)
if: matrix.os == 'windows'
run: |
echo "EQWALIZER_DIR=${{ github.workspace }}\eqwalizer\eqwalizer" >> $env:GITHUB_ENV
echo "ELP_EQWALIZER_PATH=${{ github.workspace }}\eqwalizer\eqwalizer\eqwalizer.exe" >> $env:GITHUB_ENV
- name: Test elp
# Do not run the tests in case of cross-compilation or on Windows
if: matrix.platform-arch != 'macos-latest-arm' && matrix.os != 'windows'
run: 'cargo test --no-default-features --workspace --target ${{ matrix.target }}'
- name: Build elp (No Windows)
if: matrix.os != 'windows'
run: 'cargo build --release --target ${{ matrix.target }} --config target.aarch64-unknown-linux-gnu.linker=\"aarch64-linux-gnu-gcc\"'
- name: Build elp (Windows Only)
if: matrix.os == 'windows'
run: 'cargo build --release --target ${{ matrix.target }}'
- name: Add elp to path (No Windows)
if: matrix.os != 'windows'
run: 'echo "$GITHUB_WORKSPACE/target/${{ matrix.target}}/release" >> $GITHUB_PATH'
- name: Add elp to path (Windows Only)
if: matrix.os == 'windows'
run: '"$env:GITHUB_WORKSPACE\target\${{ matrix.target }}\release" | Out-File -FilePath "$env:GITHUB_PATH" -Append'
- name: Upload elp binary (No Windows)
if: matrix.os != 'windows'
uses: "actions/upload-artifact@v4"
with:
name: elp-${{ matrix.os }}-${{ matrix.target }}-otp-${{ matrix.otp-version }}
path: target/${{ matrix.target }}/release/elp
- name: Upload elp binary (Windows Only)
if: matrix.os == 'windows'
uses: "actions/upload-artifact@v4"
with:
name: elp-${{ matrix.os }}-${{ matrix.target }}-otp-${{ matrix.otp-version }}
path: target\${{ matrix.target }}\release\elp.exe
- name: Upload eqwalizer native binary (No Windows)
if: matrix.os != 'windows'
uses: "actions/upload-artifact@v4"
with:
name: eqwalizer-${{ matrix.os }}-${{ matrix.target }}-otp-${{ matrix.otp-version }}
path: ./eqwalizer/eqwalizer/eqwalizer
- name: Upload eqwalizer native binary (Windows Only)
if: matrix.os == 'windows'
uses: "actions/upload-artifact@v4"
with:
name: eqwalizer-${{ matrix.os }}-${{ matrix.target }}-otp-${{ matrix.otp-version }}
path: .\eqwalizer\eqwalizer\eqwalizer.exe
- name: Make elp-${{ matrix.os }}-otp-${{ matrix.otp-version }}.tar.gz (No Windows)
if: matrix.os != 'windows'
run: 'tar -zcvf elp-${{ matrix.os }}-otp-${{ matrix.otp-version }}.tar.gz -C target/${{ matrix.target}}/release/ elp'
- name: Make elp-${{ matrix.os }}-otp-${{ matrix.otp-version }}.tar.gz (Windows Only)
if: matrix.os == 'windows'
run: 'tar -zcvf elp-${{ matrix.os }}-otp-${{ matrix.otp-version }}.tar.gz -C target\${{ matrix.target}}\release elp.exe'
- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
id: get_release_url
name: Get release url
if: ${{ github.event_name == 'release' }}
uses: "bruceadams/[email protected]"
- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
name: Upload release elp-${{ matrix.os }}-otp-${{ matrix.otp-version }}.tar.gz
if: ${{ github.event_name == 'release' }}
uses: "actions/[email protected]"
with:
asset_content_type: application/octet-stream
asset_name: elp-${{ matrix.os }}-${{ matrix.target }}-otp-${{ matrix.otp-version }}.tar.gz
asset_path: elp-${{ matrix.os }}-otp-${{ matrix.otp-version }}.tar.gz
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install VSCE
run: npm install -g vsce
- name: Prepare VS Code Extension to host binaries (No Windows)
if: matrix.os != 'windows'
run: mkdir -p editors/code/bin
- name: Prepare VS Code Extension to host binaries (Windows Only)
if: matrix.os == 'windows'
run: if not exist "editors\code\bin" mkdir "editors\code\bin"
shell: cmd
- name: Fetch EDB escript
uses: actions/download-artifact@v4
with:
name: edb
- name: Ensure escript is executable
run: chmod +x edb
shell: bash
- name: Verify EDB escript
run: ./edb -h || true
shell: bash
- name: Package EDB escript into VS Code Extension (No Windows)
if: matrix.os != 'windows'
run: cp edb editors/code/bin
- name: Package EDB escript into VS Code Extension (Windows Only)
if: matrix.os == 'windows'
run: cp edb editors\code\bin
- name: Package eqWAlizer binary into VS Code Extension (No Windows)
if: matrix.os != 'windows'
run: cp eqwalizer/eqwalizer/eqwalizer editors/code/bin
- name: Package eqWAlizer binary into VS Code Extension (Windows Only)
if: matrix.os == 'windows'
run: cp eqwalizer\eqwalizer\eqwalizer.exe editors\code\bin
- name: Package ELP binary into VS Code Extension (No Windows)
if: matrix.os != 'windows'
run: cp target/${{ matrix.target}}/release/elp editors/code/bin
- name: Package ELP binary into VS Code Extension (Windows Only)
if: matrix.os == 'windows'
run: cp target\${{ matrix.target}}\release\elp.exe editors\code\bin
- name: Ensure binaries are executable
run: chmod +x editors/code/bin/*
- name: npm install
working-directory: editors/code
run: npm install
- name: npm run compile
working-directory: editors/code
run: npm run compile
- name: Package Extension
working-directory: editors/code
run: vsce package --target ${{ matrix.vscode-target }}
- name: Rename Package
working-directory: editors/code
run: mv erlang-language-platform-*.vsix erlang-language-platform.vsix
- name: Upload Extension (No Windows)
if: matrix.os != 'windows'
uses: "actions/upload-artifact@v4"
with:
name: elp-${{ matrix.os}}-${{ matrix.target }}-otp-${{ matrix.otp-version }}.vsix
path: editors/code/erlang-language-platform.vsix
- name: Upload Extension (Windows Only)
if: matrix.os == 'windows'
uses: "actions/upload-artifact@v4"
with:
name: elp-${{ matrix.os}}-${{ matrix.target }}-otp-${{ matrix.otp-version }}.vsix
path: editors\code\erlang-language-platform.vsix
- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
name: Upload Extension Package (No Windows)
if: ${{ github.event_name == 'release' && matrix.os != 'windows' }}
uses: "actions/[email protected]"
with:
asset_content_type: application/octet-stream
asset_name: elp-${{ matrix.os }}-${{ matrix.target }}-otp-${{ matrix.otp-version }}.vsix
asset_path: editors/code/erlang-language-platform.vsix
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"
- env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
name: Upload Extension Package (Windows Only)
if: ${{ github.event_name == 'release' && matrix.os == 'windows' }}
uses: "actions/[email protected]"
with:
asset_content_type: application/octet-stream
asset_name: elp-${{ matrix.os }}-${{ matrix.target }}-otp-${{ matrix.otp-version }}.vsix
asset_path: editors\code\erlang-language-platform.vsix
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"
- name: Publish extension to marketplace
working-directory: editors/code
if: ${{ github.event_name == 'release' && matrix.vscode-publish && matrix.os != 'windows' }}
run: vsce publish -p ${{ secrets.VSCE_PAT }} --packagePath erlang-language-platform.vsix