Skip to content

0.2.0

0.2.0 #9

Workflow file for this run

name: CI
on:
push:
branches:
- '*'
pull_request:
branches:
- main
release:
types: [published]
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-22.04
otp-version: 27
rebar3-version: 3.24.0
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp-version}}
# TODO(T206197595): Restore once OTP 28 is generally available
# rebar3-version: ${{matrix.rebar3-version}}
- name: Cache custom Erlang/OTP build
uses: actions/cache@v4
id: otp-cache
with:
path: otp-bin
key: ${{ runner.os }}-otp-${{ hashFiles(format('{0}{1}', github.workspace, '/otp')) }}
- name: Build and install custom version of Erlang/OTP
working-directory: otp
run: ./configure --prefix=$(pwd)/../otp-bin && make -j$(nproc) && make -j$(nproc) install
if: steps.otp-cache.outputs.cache-hit != 'true'
- name: Patch PATH
run: echo $(pwd)/otp-bin/bin >> $GITHUB_PATH
- name: Cache Hex packages
uses: actions/cache@v4
with:
path: ~/.cache/rebar3/hex/hexpm/packages
key: ${{ runner.os }}-hex-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.lock')) }}
restore-keys: |
${{ runner.os }}-hex-
# TODO(T206197595): Remove once OTP 28 is generally available
- name: Checkout rebar3 repository
uses: "actions/checkout@v3"
with:
repository: erlang/rebar3
path: rebar3
ref: ${{ matrix.rebar3-version }}
- name: Bootstrap rebar3
run: ./bootstrap
working-directory: rebar3
- name: Add rebar3 to PATH
run: echo $(pwd)/rebar3 >> $GITHUB_PATH
- name: Compile
run: rebar3 compile
- name: Escriptize
run: rebar3 escriptize
- name: Test
run: rebar3 ct
- name: Format
run: rebar3 fmt --check
- name: XRef
run: rebar3 xref
- name: Create tarball edb-${{ matrix.os }}-otp-${{ matrix.otp-version }}.tar.gz
run: 'tar -zcvf edb-${{ matrix.os }}-otp-${{ matrix.otp-version }}.tar.gz -C _build/default/bin edb'
- name: Upload EDB escript
uses: "actions/upload-artifact@v4"
with:
name: edb-${{ matrix.os }}-otp-${{ matrix.otp-version }}.tar.gz
path: edb-${{ matrix.os }}-otp-${{ matrix.otp-version }}.tar.gz
- 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 asset edb-${{ 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: edb-${{ matrix.os }}-otp-${{ matrix.otp-version }}.tar.gz
asset_path: edb-${{ matrix.os }}-otp-${{ matrix.otp-version }}.tar.gz
upload_url: "${{ steps.get_release_url.outputs.upload_url }}"
- name: Cache Dialyzer PLTs
uses: actions/cache@v4
with:
path: ~/.cache/rebar3/rebar3_*.plt
key: ${{ runner.os }}-dialyzer-${{ hashFiles(format('{0}{1}', github.workspace, '/rebar.config')) }}
restore-keys: |
${{ runner.os }}-dialyzer-
# T198620072: Solve the existing Dialyzer issues, then enable this
# - name: Dialyzer
# run: rebar3 dialyzer