Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

Commit

Permalink
Rewrite tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Gashmob committed Jul 8, 2023
1 parent ac7cac4 commit 2204c53
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 134 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/clang-tidy.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/codeql.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/test.yml

This file was deleted.

84 changes: 84 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Tests

on:
push:
paths:
- "src/**"
- "tests/**"
- ".github/workflows/tests.yml"
pull_request:
paths:
- "src/**"
- "tests/**"
- ".github/workflows/tests.yml"

jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Setup LCOV
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: hrishikesh-kadam/setup-lcov@v1

- name: Configure CMake
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Debug -DCODE_COVERAGE=ON
- name: Configure CMake
if: ${{ matrix.os != 'ubuntu-latest' }}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Debug

- name: Build
run: cmake --build ${{github.workspace}}/build --target tests

- name: Run tests
run: cd ${{github.workspace}}/build && ctest

- name: Generate coverage report
if: ${{ matrix.os == 'ubuntu-latest' }}
run: ${{github.workspace}}/coverage.sh
- name: Upload coverage reports to Codecov
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{github.workspace}}/coverage.info

clang-tidy:
needs:
- tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

- name: Run clang-tidy
run: clang-tidy -p ${{github.workspace}}/build/ src/**/*.{cpp,hpp,h} tests/**/*.cpp

builds:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=Release

- name: Build
run: cmake --build ${{github.workspace}}/build

- name: Install
run: cmake --install ${{github.workspace}}/build

- name: Run
run: filc --version
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Version](version.svg)

[![Tests](https://github.com/Fil-Language/Filc/actions/workflows/test.yml/badge.svg?branch=master)](https://github.com/Fil-Language/Filc/actions/workflows/test.yml)
[![CodeFactor](https://www.codefactor.io/repository/github/fil-language/filc/badge)](https://www.codefactor.io/repository/github/fil-language/filc)
[![Tests](https://github.com/Fil-Language/Filc/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/Fil-Language/Filc/actions/workflows/tests.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/749c60420a9244dbac4ce1e0bd594f1e)](https://www.codacy.com/gh/Fil-Language/Filc/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Fil-Language/Filc&utm_campaign=Badge_Grade)
[![codecov](https://codecov.io/gh/Fil-Language/Filc/branch/master/graph/badge.svg?token=BRT1CEUTW9)](https://codecov.io/gh/Fil-Language/Filc)

Fil language compiler (version in `src/VERSION.h`)
Fil language compiler (version in `src/lib/utils/VERSION.h`)

Have used `figlet -f slant "Filc"` for the version message.

Expand All @@ -32,8 +31,8 @@ grammar : [https://fil.ktraini.com/doc/advanced/grammar](https://fil.ktraini.com
### GitHub actions

- [Checkout](https://github.com/marketplace/actions/checkout)
- [Install LLVM and Clang](https://github.com/marketplace/actions/install-llvm-and-clang)
- [Codacy coverage report](https://github.com/codacy/codacy-coverage-reporter-action)
- [Setup LCOV](https://github.com/marketplace/actions/setup-lcov)
- [Codecov coverage report](https://github.com/marketplace/actions/codecov)

### `version.sh`

Expand Down

0 comments on commit 2204c53

Please sign in to comment.