Skip to content

Update ReadTheDocs yaml #31

Update ReadTheDocs yaml

Update ReadTheDocs yaml #31

Workflow file for this run

name: build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
# get version
- name: get version
id: get_version
uses: gvilitechltd/get-version-action@v2
- name: show version
run: echo building ${{ steps.get_version.outputs.version }}
# install and cache dependencies
- name: install cmake
run: sudo apt-get update && sudo apt-get install -yq cmake gcc g++
- name: cache Catch2
uses: actions/[email protected]
id: cache-catch2
with:
path: "~/Catch2-2.13.2"
key: Catch2-2.13.2
- name: install Catch2
env:
CACHE_HIT: ${{ steps.cache-catch2.outputs.cache-hit }}
run: |
if [[ "$CACHE_HIT" == 'true' ]]; then
(cd ~/Catch2-2.13.2 && sudo cmake --build build/ --target install)
else
sudo apt-get update && sudo apt-get install -yq wget unzip
wget https://github.com/catchorg/Catch2/archive/v2.13.2.zip && unzip v2.13.2.zip -d ~
(cd ~/Catch2-2.13.2 && cmake -Bbuild -H. -DBUILD_TESTING=OFF && sudo cmake --build build/ --target install)
fi
# build project
- name: show tools
run: |
gcc --version
cmake --version
- name: mkdir
run: mkdir build
- name: cmake build
run: |
cmake -DCMAKE_BUILD_TYPE=Release -Bbuild -H.
cmake -DCMAKE_BUILD_TYPE=Release -DSWIFFT_ENABLE_OPENMP=On -Bbuild-omp -H.
- name: cmake make
run: for conf in "" -omp; do cmake --build build${conf}/ --target all; done
env:
MAKEFLAGS: "-j2"
# run tests
- name: run main tests
run: for conf in "" -omp; do build${conf}/test/swifft_catch; done
# make package
- name: make package
run: for conf in "" -omp; do (mkdir pack${conf} && cd pack${conf} && mkdir lib package && cp -p ../build/src/libswifft.{a,so} lib/ && cp -rp ../include . && tar czfv package/libswifft-${{ steps.get_version.outputs.version }}${conf}.tgz lib include); done
# upload package
- name: upload package
uses: actions/upload-artifact@v2
if: ${{ !env.ACT }}
with:
name: libswifft-${{ steps.get_version.outputs.version }}.tgz
path: pack/package/libswifft-${{ steps.get_version.outputs.version }}.tgz
# upload package omp
- name: upload package omp
uses: actions/upload-artifact@v2
if: ${{ !env.ACT }}
with:
name: libswifft-${{ steps.get_version.outputs.version }}-omp.tgz
path: pack-omp/package/libswifft-${{ steps.get_version.outputs.version }}-omp.tgz