Adding new APIs #257
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DLIO Profiler Build and Test | |
on: | |
pull_request: | |
branches: [ main, dev ] | |
push: | |
jobs: | |
build-and-test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-20.04, ubuntu-22.04] | |
dir: ["clone", "github"] | |
perm: ["root", "user"] | |
name: ${{ matrix.os }}-${{ matrix.dir }}-${{ matrix.perm }} | |
runs-on: ${{ matrix.os }} | |
env: | |
CC: gcc | |
CXX: g++ | |
DIR: ${{ matrix.dir }} | |
PERM: ${{ matrix.perm }} | |
OS: ${{ matrix.os }} | |
steps: | |
- name: Push checkout | |
if: github.event_name == 'push' | |
uses: actions/checkout@v3 | |
- name: PR checkout | |
if: github.event_name == 'pull_request' | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Install additional packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install gcc g++ libtool-bin openmpi-bin libopenmpi-dev | |
sudo apt-get install python3.10 python3-pip | |
sudo apt-get install gcovr | |
- name: Install dlio benchmark | |
if: matrix.os == 'ubuntu-22.04' && matrix.dir == 'clone' && matrix.perm == 'user' | |
run: | | |
LOC=git+https://github.com/argonne-lcf/dlio_benchmark.git@main | |
if [[ $PERM == 'user' ]]; then | |
export DLIO_LOGGER_USER=1 | |
echo pip install ${LOC} | |
pip install ${LOC} | |
else | |
echo pip install ${LOC} | |
sudo pip install ${LOC} | |
fi | |
- name: Build from ${{ matrix.dir }} on ${{ matrix.perm }} | |
run: | | |
export CMAKE_BUILD_TYPE=PROFILE | |
export DLIO_PROFILER_ENABLE_TESTS=ON | |
if [ $OS == 'ubuntu-22.04' ] && [ $DIR == 'github' ] && [ $PERM == 'user' ]; then | |
export ENABLE_DLIO_BENCHMARK_TESTS=ON | |
fi | |
LOC=. | |
if [[ $DIR == 'github' ]]; then | |
LOC=git+https://github.com/hariharan-devarajan/dlio-profiler.git@dev | |
fi | |
if [[ $PERM == 'user' ]]; then | |
export DLIO_LOGGER_USER=1 | |
echo pip install -v ${LOC} | |
pip install -v ${LOC} | |
else | |
echo pip install -v ${LOC} | |
sudo pip install -v ${LOC} | |
fi | |
- name: Test ctest | |
if: matrix.os == 'ubuntu-22.04' && matrix.dir == 'clone' && matrix.perm == 'user' | |
run: | | |
pip install -r test/py/requirements.txt | |
cd build/temp*/dlio_profiler_py | |
ctest -VV | |
- name: Create Coverage | |
if: matrix.os == 'ubuntu-22.04' && matrix.dir == 'clone' && matrix.perm == 'user' | |
run: | | |
mkdir coverage | |
FILE=$PWD/coverage/coverage.json | |
cd build | |
COVERALLS_REPO_TOKEN=${{ secrets.GITHUB_TOKEN }} gcovr -r ../ . --coveralls $FILE -e ../test/ -e ../src/example | |
if [ -e '$FILE' ]; then | |
sed -i'' -e 's/"service_name": "github-actions-ci"/"service_name": "github"/' '$FILE' | |
fi | |
cat $FILE | |
curl -v -F json_file=@$FILE https://coveralls.io/api/v1/jobs |