Skip to content

Bump tj-actions/changed-files from 18.4 to 41 in /.github/workflows #59

Bump tj-actions/changed-files from 18.4 to 41 in /.github/workflows

Bump tj-actions/changed-files from 18.4 to 41 in /.github/workflows #59

Workflow file for this run

# Copyright 2014-2022 Will Cunningham
#
# This file is part of FastMath.
#
# Licensed under the GNU General Public License 3.0 (the "License").
# A copy of the License may be obtained with this software package or at
#
# https://www.gnu.org/licenses/gpl-3.0.en.html
#
# Use of this file is prohibited except in compliance with the License. Any
# modifications or derivative works of this file must retain this copyright
# notice, and modified files must contain a notice indicating that they have
# been altered from the originals.
#
# FastMath is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the License for more details.
name: tests
on:
pull_request:
workflow_run:
workflows: [changelog]
types: [completed]
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Check out head
uses: actions/checkout@v3
with:
persist-credentials: false
- name: Install boost
id: boost
uses: MarkusJx/[email protected]
with:
boost_version: 1.76.0
platform_version: 20.04
- name: Install gcc gtest and lcov
run: |
sudo apt install gcc-11 g++-11
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
sudo apt-get install -y libgtest-dev lcov
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
sudo cp lib/*.a /usr/lib
sudo ln -s /usr/lib/libgtest.a /usr/local/lib/libgtest.a
sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/libgtest_main.a
- name: Run unit tests
env:
CPATH: ${{ steps.boost.outputs.BOOST_ROOT }}
run: |
g++ --version
lcov --version
cd tests
echo $CPATH
make coverage
- name: Upload report to Codecov
uses: codecov/codecov-action@v2
with:
files: ./tests/coverage.info
flags: unittests
- name: Get latest release
uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
if: github.ref == 'refs/heads/develop'
with:
semver_only: true
- name: Push to master
if: github.ref == 'refs/heads/develop'
run: |
MASTER_VERSION="$(echo ${{ steps.get-latest-tag.outputs.tag }} | cut -c2- )"
VERSION="$(cat ./VERSION)"
if [ "$MASTER_VERSION" = "$VERSION" ] ; then
echo "$VERSION has been previously released."
else
git config user.name "FastMathOpsBot"
git config user.email "[email protected]"
git remote set-url origin https://${{ secrets.FASTMATH_OPS_BOT_TOKEN }}@github.com/wjcunningham7/fastmath.git
git push origin HEAD:master
fi