Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 79 additions & 83 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,6 @@ jobs:
- otp_version: 21
send_coverage: true
run_dialyzer: true
build_docs: true

- otp_version: 20

- otp_version: 19

- otp_version: 19
erl_hist: true

- otp_version: 18
# old_rebar fails with "Package not found in registry: {<<"hdr_histogram">>,<<"0.5.0">>}."
# with hdr_histogram NIF: xprof_core_hist_SUITE: Segmentation fault (core dumped)
erl_hist: true
old_cowboy: true

steps:
- uses: actions/checkout@v3
Expand All @@ -72,57 +58,112 @@ jobs:
run: make dialyzer
timeout-minutes: 8

- if: matrix.build_docs
run: make doc

- if: matrix.send_coverage && success()
run: ./rebar3 as test coveralls send
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true

test_json_lib:
name: Test different json lib (${{ matrix.json_lib }} | OTP ${{ matrix.otp_version }})
# Same as the "test" job but for OTP 18-20, whose containers ship a glibc
# too old for the node20 runtime that actions/checkout and actions/cache
# now require. This job checks out with plain git and skips the cache.
test_legacy:
name: OTP ${{ matrix.otp_version }} (legacy)
runs-on: ubuntu-latest

container: erlang:${{ matrix.otp_version }}

strategy:
fail-fast: false
matrix:
otp_version: [19, 21]
json_lib: [jiffy, jsx, thoas]
include:
- otp_version: 20

- otp_version: 19
old_cowboy: true

# thoas requires OTP 21+
- otp_version: 19
json_lib: thoas
skip: true
erl_hist: true

# fails with "Package not found in registry: jiffy-1.1.0."
#- otp_version: 18
# old_rebar: true
# old_cowboy: true
- otp_version: 18
# old_rebar fails with "Package not found in registry: {<<"hdr_histogram">>,<<"0.5.0">>}."
# with hdr_histogram NIF: xprof_core_hist_SUITE: Segmentation fault (core dumped)
erl_hist: true
old_cowboy: true

steps:
- uses: actions/checkout@v3
- name: Checkout with git (avoids node-based actions on old glibc)
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git init -q
git remote add origin "https://github.com/${{ github.repository }}"
git fetch -q --depth 1 origin "${{ github.ref }}"
git checkout -q FETCH_HEAD

- if: matrix.old_rebar
run: echo "REBAR3=./rebar3" >> $GITHUB_ENV

- if: matrix.erl_hist
run: echo "XPROF_ERL_HIST=true" >> $GITHUB_ENV

- if: matrix.old_cowboy
run: echo "COWBOY_VERSION=1.1.2" >> $GITHUB_ENV

- run: make test

test_json_lib:
name: Test different json lib (${{ matrix.json_lib }} | OTP ${{ matrix.otp_version }})
runs-on: ubuntu-latest

container: erlang:${{ matrix.otp_version }}

strategy:
fail-fast: false
matrix:
otp_version: [21]
json_lib: [jiffy, jsx, thoas]

steps:
- uses: actions/checkout@v3

- name: Cache hex packages
uses: actions/cache@v3
with:
path: $HOME/.cache/rebar3
key: ${{ matrix.otp_version }}-rebar3-cache-json-lib

- if: ${{ !matrix.skip }}
run: make test_${{ matrix.json_lib }}
- run: make test_${{ matrix.json_lib }}

test_docs:
name: Test generating documentation
runs-on: ubuntu-latest

strategy:
matrix:
include:
- elixir: 1.15.x
otp_version: 26
rebar3: '3.22.1'
# hdr_histogram NIF requires the below PR to be merged to build on OTP 26
# https://github.com/HdrHistogram/hdr_histogram_erl/pull/44
erl_hist: true

steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp_version}}
elixir-version: ${{matrix.elixir}}
rebar3-version: ${{matrix.rebar3}}

- if: matrix.erl_hist
run: echo "XPROF_ERL_HIST=true" >> $GITHUB_ENV

- name: Cache hex packages
uses: actions/cache@v3
with:
path: $HOME/.cache/rebar3
key: ${{ matrix.otp_version }}-rebar3-cache

- run: make gen_ex_doc

test_elixir:
name: Test with Elixir (Elixir ${{matrix.elixir}} | OTP ${{matrix.otp_version}})
Expand All @@ -131,60 +172,15 @@ jobs:
fail-fast: false
matrix:
include:
# runner ubuntu-20.4 is only compatible with OTP 20+
# earlier OTP versions fail with:
# no match of right hand side value: {:error, {:ssl, {'no such file or directory', 'ssl.app'}}}
# running ubuntu-18.4 was removed on 2022.04.03
# https://github.com/actions/runner-images/issues/6002
# - elixir: 1.4.x
# otp_version: 18
# rebar3: '3.7.4'
# old_cowboy: true
# # with hdr_histogram NIF: xprof_core_hist_SUITE: Segmentation fault (core dumped)
# erl_hist: true
# os: ubuntu-18.04

- elixir: 1.5.x
otp_version: 20
rebar3: '3.7.4'
old_cowboy: true
erl_hist: true
os: ubuntu-20.04

- elixir: 1.6.x
otp_version: 20
rebar3: '3.15.2'
os: ubuntu-20.04

- elixir: 1.7.x
otp_version: 20
rebar3: '3.15.2'
os: ubuntu-20.04

- elixir: 1.8.x
otp_version: 20
rebar3: '3.15.2'
os: ubuntu-20.04

- elixir: 1.9.x
otp_version: 20
rebar3: '3.15.2'
os: ubuntu-20.04

- elixir: 1.10.x
otp_version: 21
rebar3: '3.15.2'
os: ubuntu-20.04

- elixir: 1.11.x
otp_version: 22
- elixir: 1.11.4
otp_version: 24
rebar3: '3.18.0'
os: ubuntu-20.04
os: ubuntu-latest

- elixir: 1.12.x
otp_version: 23
otp_version: 24
rebar3: '3.19.0'
os: ubuntu-20.04
os: ubuntu-latest

- elixir: 1.13.x
otp_version: 24
Expand Down
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
JS_PRIV=apps/xprof_gui/priv
BIN_DIR:=node_modules/.bin
VERSION:=$(shell grep vsn apps/xprof/src/xprof.app.src | cut -d '"' -f 2)
REBAR3?=$(shell which rebar3 || echo ./rebar3)

# this will update cowboy version based on rebar.config overwriting the lock file
Expand Down Expand Up @@ -63,16 +62,19 @@ test_thoas:
doc:
$(REBAR3) edoc

~/.mix/escripts/ex_doc:
mix escript.install hex ex_doc --force

./doc/src/readme.md: README.md
sed -e 's|(doc/src/querysyntax.md)|(querysyntax.html)|' \
-e 's|doc/assets/|assets/|' \
-e '1 s|\[!\[.*||' README.md > ./doc/src/readme.md

gen_ex_doc: ~/.mix/escripts/ex_doc ./doc/docs.exs ./doc/src/readme.md ./doc/src/querysyntax.md
~/.mix/escripts/ex_doc XProf $(VERSION) "doc/ebin" -c ./doc/docs.exs
gen_ex_doc: ./doc/src/readme.md
$(MAYBE_UPDATE_COWBOY)
$(MAYBE_UNLOCK_HIST)
$(REBAR3) as docs ex_doc --app xprof_core
$(REBAR3) as docs ex_doc --app xprof_gui
cp _build/docs/lib/xprof_core/ebin/xprof_core.beam _build/docs/lib/xprof/ebin
cp _build/docs/lib/xprof_gui/ebin/xprof_gui_rest.beam _build/docs/lib/xprof/ebin
$(REBAR3) as docs ex_doc --app xprof

dialyzer:
$(MAYBE_UPDATE_COWBOY)
Expand All @@ -82,4 +84,7 @@ dialyzer:
publish:
$(REBAR3) as publish hex publish --deps_from_config

.PHONY: compile dev dev_back_end dev_front_end npm bootstrap_front_end test_front_end build_prod_front_end test doc gen_ex_doc dialyzer publish
publish_docs: gen_ex_doc
$(REBAR3) as publish hex docs

.PHONY: compile dev dev_back_end dev_front_end npm bootstrap_front_end test_front_end build_prod_front_end test doc gen_ex_doc dialyzer publish publish_docs
1 change: 1 addition & 0 deletions apps/xprof/src/xprof.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
,{env,[]}
,{modules, []}
,{files, ["rebar.config", "src/"]}
,{doc, "doc"}
,{licenses, ["BSD-3-Clause"]}
,{maintainers, ["Marcin Kasprowicz", "Marcin Kolodziej",
"Michal Niec", "Pawel Pikula",
Expand Down
1 change: 1 addition & 0 deletions apps/xprof_core/src/test_module.erl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
%%% @doc Module to generate sample data
%%% start tracing on `test_module:expensive_fun/1'
%%% @end
%%% @private
-module(test_module).
-export([start/0]).

Expand Down
Loading
Loading