Skip to content
Open
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
161 changes: 74 additions & 87 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- macos-10.15
- ubuntu-18.04
- macos-10.15
# Build binaries on older systems to require lower versions of libc and
# other system libraries.

runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- run: npm install esy
- run: echo PATH=$(pwd)/node_modules/.bin:$PATH >> $GITHUB_ENV
- run: make -C test/js full-test
- if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
run: bash ./test/ci/binaries.sh
- uses: actions/checkout@v2
- run: npm install esy
- run: echo PATH=$(pwd)/node_modules/.bin:$PATH >> $GITHUB_ENV
- run: make -C test/js full-test
- if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
run: bash ./test/ci/binaries.sh

opam:
if: ${{github.ref != 'refs/heads/binaries'}}
Expand All @@ -30,92 +30,79 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-latest
- ubuntu-latest
ocaml:
- 4.13.1
- 4.12.1
- 4.11.2
- 4.10.2
- 4.09.1
- 4.08.1
- 4.07.1
- 4.06.1
- 4.05.0
- 4.04.2
- 4.14.0
include:
- os: macos-latest
ocaml: 4.12.1
# ocamlformat 0.16.0, used in testing, doesn't support OCaml 4.13, and
# we are using a Linux binary of it. So, hold the Mac build back to
# 4.12 for now, and install ocamlformat from opam on Mac.
- os: windows-latest
ocaml: 4.12.1
- os: macos-latest
ocaml: 4.14.0
# ocamlformat 0.16.0, used in testing, doesn't support OCaml 4.13, and
# we are using a Linux binary of it. So, hold the Mac build back to
# 4.12 for now, and install ocamlformat from opam on Mac.
- os: windows-latest
ocaml: 4.14.0

runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- uses: avsm/setup-ocaml@v2
with:
ocaml-compiler: ${{matrix.ocaml}}
- uses: actions/checkout@v2
- uses: avsm/setup-ocaml@v2
with:
ocaml-compiler: ${{matrix.ocaml}}

- name: Install opam dependencies
run: opam install --deps-only --yes .
- name: Install opam dependencies
run: opam install --deps-only --yes .
# - name: Install ocamlformat (Linux)
# if: ${{runner.os == 'Linux'}}
# run: |
# wget https://github.com/aantron/ocamlformat-binary/releases/download/0.24.1/ocamlformat
# sudo mv ocamlformat /usr/local/bin/ocamlformat
# sudo chmod a+x /usr/local/bin/ocamlformat
- name: Install ocamlformat (non-Linux)
# if: ${{runner.os != 'Linux'}}
run: opam install ocamlformat.0.24.1 --yes

- name: Install ocamlformat (Linux)
if: ${{runner.os == 'Linux'}}
run: |
wget https://github.com/aantron/ocamlformat-binary/releases/download/0.15.0/ocamlformat
sudo mv ocamlformat /usr/local/bin/ocamlformat
sudo chmod a+x /usr/local/bin/ocamlformat
- name: Install ocamlformat (non-Linux)
if: ${{runner.os != 'Linux'}}
run: opam install ocamlformat.0.16.0 --yes
- name: Install coreutils (Mac)
if: ${{runner.os == 'macOS'}}
run: brew install coreutils

- name: Install coreutils (Mac)
if: ${{runner.os == 'macOS'}}
run: brew install coreutils
- name: Version feedback
run: |
opam --version
opam exec -- ocaml -version
opam exec -- ocamlformat --version
truncate --version

- name: Version feedback
run: |
opam --version
opam exec -- ocaml -version
opam exec -- ocamlformat --version
truncate --version
- name: Build
run: opam exec -- make build

- name: Build
run: opam exec -- make build
- name: Test
if: ${{runner.os != 'Windows'}}
run: |
case `opam exec -- ocamlc -version` in
"4.07.1") TEST_ALIAS=@compatible;;
"4.06.1") TEST_ALIAS=@compatible;;
"4.05.0") TEST_ALIAS=@compatible;;
"4.04.2") TEST_ALIAS=@compatible;;
*) TEST_ALIAS=@runtest;;
esac
unset GITHUB_ACTIONS
unset GITHUB_RUN_NUMBER
opam exec -- make test TEST=$TEST_ALIAS

- name: Test
if: ${{runner.os != 'Windows'}}
run: |
case `opam exec -- ocamlc -version` in
"4.07.1") TEST_ALIAS=@compatible;;
"4.06.1") TEST_ALIAS=@compatible;;
"4.05.0") TEST_ALIAS=@compatible;;
"4.04.2") TEST_ALIAS=@compatible;;
*) TEST_ALIAS=@runtest;;
esac
unset GITHUB_ACTIONS
unset GITHUB_RUN_NUMBER
opam exec -- make test TEST=$TEST_ALIAS
- name: Usage test
run: |
opam install reason js_of_ocaml --yes
opam exec -- make clean-usage usage

# Reason requires OCaml <= 4.12.
- name: Usage test
if: ${{matrix.ocaml == '4.12.1' && runner.os == 'Linux'}}
run: |
opam install reason js_of_ocaml --yes
opam exec -- make clean-usage usage

- name: Submit self-coverage to Coveralls
if: ${{matrix.ocaml == '4.12.1' && runner.os == 'Linux'}}
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{secrets.GITHUB_TOKEN}}
PULL_REQUEST_NUMBER: ${{github.event.number}}
run: |
(unset GITHUB_ACTIONS && unset GITHUB_RUN_NUMBER && \
unset COVERALLS_REPO_TOKEN && unset PULL_REQUEST_NUMBER && \
opam exec -- make clean self-coverage)
(cd _self && \
_build/install/default/bin/meta-bisect-ppx-report \
send-to Coveralls bisect*.meta)
- name: Submit self-coverage to Coveralls
continue-on-error: true
env:
COVERALLS_REPO_TOKEN: ${{secrets.GITHUB_TOKEN}}
PULL_REQUEST_NUMBER: ${{github.event.number}}
run: |
(unset GITHUB_ACTIONS && unset GITHUB_RUN_NUMBER && \
unset COVERALLS_REPO_TOKEN && unset PULL_REQUEST_NUMBER && \
opam exec -- make clean self-coverage)
(cd _self && \
_build/install/default/bin/meta-bisect-ppx-report \
send-to Coveralls bisect*.meta)
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ lib/
_esy/
*.tgz
package/

*.esy.lock
esy.lock
.DS_Store
Binary file added bin/macos_m1/bisect-ppx-report
Binary file not shown.
Binary file added bin/macos_m1/ppx
Binary file not shown.
5 changes: 3 additions & 2 deletions binaries.esy.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"dependencies": {
"ocaml": ">= 4.2.0",
"ocaml": ">= 4.14.0",
"@opam/cmdliner": "^1.0.0",
"@opam/dune": "^2.7.0",
"@opam/ppxlib": ">= 0.21.0"
"@opam/ppxlib": ">=0.26.0",
"@opam/ocaml-lsp-server": "1.11.6"
},
"esy": {
"build": "dune build -p bisect_ppx",
Expand Down
3 changes: 1 addition & 2 deletions bsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "bisect_ppx",
"name": "@jfrolich/bisect_ppx",
"namespace": "Bisect",
"sources": [
"src/common",
"src/runtime/js"
]
}
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bisect_ppx",
"name": "@jfrolich/bisect_ppx",
"description": "Code coverage for OCaml and Reason",
"version": "2.8.1",
"version": "2.8.3",
"license": "MIT",
"homepage": "https://github.com/aantron/bisect_ppx",
"bugs": {
Expand Down Expand Up @@ -35,5 +35,8 @@
"src",
"bin",
"bisect-ppx-report"
]
],
"dependencies": {
"rescript": "10.1.0"
}
}
19 changes: 13 additions & 6 deletions src/npm-install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
#!/usr/bin/env bash
UNAME=`uname -s`
ARCH=`uname -m`
case "$UNAME" in
"Linux") OS=linux;;
"Darwin")
case "$ARCH" in
"arm64") OS=macos_m1;;
*) OS=macos;;
esac;;
*) echo "Unknown OS '$UNAME'; falling back to a source build."; esy_build;;
esac

esy_build() {
set -e
Expand All @@ -8,22 +19,18 @@ esy_build() {
cp _build/default/src/ppx/js/ppx.exe ./ppx
esy -P binaries.esy.json dune build -p bisect_ppx src/report/main.exe
cp _build/default/src/report/main.exe ./bisect-ppx-report
# cp ./ppx bin/$OS/ppx
# cp ./bisect-ppx-report bin/$OS/bisect-ppx-report
exit 0
}

UNAME=`uname -s`
RESULT=$?
if [ "$RESULT" != 0 ]
then
echo "Cannot detect OS; falling back to a source build."
esy_build
fi

case "$UNAME" in
"Linux") OS=linux;;
"Darwin") OS=macos;;
*) echo "Unknown OS '$UNAME'; falling back to a source build."; esy_build;;
esac

if [ ! -f bin/$OS/ppx ]
then
Expand Down
Loading