├── .github └── workflows │ └── enforce-license-compliance.yml ├── .travis.yml ├── LICENSE.md ├── README.md └── hello.vala /.github/workflows/enforce-license-compliance.yml: -------------------------------------------------------------------------------- 1 | name: Enforce License Compliance 2 | 3 | on: 4 | pull_request: 5 | branches: [main, master] 6 | 7 | jobs: 8 | enforce-license-compliance: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: 'Enforce License Compliance' 12 | uses: getsentry/action-enforce-license-compliance@57ba820387a1a9315a46115ee276b2968da51f3d # main 13 | with: 14 | fossa_api_key: ${{ secrets.FOSSA_API_KEY }} 15 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: c 2 | 3 | before_install: 4 | - sudo apt-add-repository --yes ppa:vala-team 5 | - sudo apt-get update --quiet 6 | - sudo apt-get install --yes valac libglib2.0-dev 7 | 8 | script: 9 | - valac --ccode --debug hello.vala 10 | - gcc $(pkg-config --cflags glib-2.0 gobject-2.0) -ftest-coverage -fprofile-arcs -o hello hello.c $(pkg-config --libs glib-2.0 gobject-2.0) 11 | - ./hello 12 | - gcov hello.vala 13 | 14 | after_success: 15 | - bash <(curl -s https://codecov.io/bash) 16 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Codecov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Codecov][1] Vala Example 2 | ## Guide 3 | ### Travis Setup 4 | 5 | Add to your `.travis.yml` file. 6 | ```yml 7 | language: c 8 | after_success: 9 | - bash <(curl -s https://codecov.io/bash) 10 | ``` 11 | ### Produce Coverage Reports 12 | 13 | Since Vala translate to C, [the usage same directives for C/C++](https://github.com/codecov/example-c) 14 | apply. The ``--ccode`` and ``--debug`` flags have to be specified so that the 15 | C coverage can be properly mapped to the original sources. 16 | 17 | ```bash 18 | valac --debug --ccode hello.vala 19 | gcc $(pkg-config --cflags --libs glib-2.0 gobject-2.0) -ftest-coverage -fprofile-arcs -o hello hello.c 20 | ./hello 21 | gcov hello.vala 22 | ``` 23 | 24 | ## Meson 25 | 26 | To enable coverage with [Meson][5], specify the `-D b_coverage=true` project option. 27 | 28 | ```bash 29 | mkdir build && cd build 30 | meson -D b_coverage=true .. 31 | ninja 32 | ninja test 33 | ``` 34 | 35 | ## Caveats 36 | ### Private Repos 37 | Add to your `.travis.yml` file. 38 | ```yml 39 | after_success: 40 | - bash <(curl -s https://codecov.io/bash) -t uuid-repo-token 41 | ``` 42 | 43 | 1. More documentation at https://docs.codecov.io 44 | 2. Configure codecov through the `codecov.yml` https://docs.codecov.io/docs/codecov-yaml 45 | 46 | We are happy to help if you have any questions. Please contact email our Support at [support@codecov.io](mailto:support@codecov.io) 47 | 48 | [1]: https://codecov.io/ 49 | [5]: http://mesonbuild.com/ 50 | -------------------------------------------------------------------------------- /hello.vala: -------------------------------------------------------------------------------- 1 | public bool t = true; 2 | 3 | public int main () 4 | { 5 | if (t) 6 | stdout.printf ("on this line\n"); 7 | else 8 | stdout.printf ("but not here\n"); 9 | 10 | return 0; 11 | } 12 | --------------------------------------------------------------------------------