├── .github └── workflows │ └── enforce-license-compliance.yml ├── .travis.yml ├── LICENSE.md ├── README.md └── hello.f90 /.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 | sudo: required 3 | before_install: 4 | - sudo apt-get install gfortran 5 | 6 | script: 7 | - gfortran -fprofile-arcs -ftest-coverage -O0 hello.f90 -o hello 8 | - ./hello 9 | 10 | after_success: 11 | - bash <(curl -s https://codecov.io/bash) 12 | -------------------------------------------------------------------------------- /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] Fortran Example 2 | ## Guide 3 | ### Travis Setup 4 | 5 | Add to your `.travis.yml` file. 6 | ```yml 7 | language: c 8 | 9 | after_success: 10 | - bash <(curl -s https://codecov.io/bash) 11 | ``` 12 | ### Produce Coverage Reports 13 | 14 | Fortran outpus `gcov` reports for all your files covered. To create 15 | these files all you need to do is to add the `-fprofile-arcs -ftest-coverage` flags to `gfortran` when building. 16 | 17 | ``` 18 | gfortran -fprofile-arcs -ftest-coverage -O0 hello.f90 -o hello 19 | ./hello 20 | ``` 21 | 22 | For a slightly more complicated version check out the 23 | [json-fortran](https://github.com/jacobwilliams/json-fortran) project. 24 | 25 | ## Caveats 26 | ### Private Repos 27 | Add to your `.travis.yml` file. 28 | ```yml 29 | after_success: 30 | - bash <(curl -s https://codecov.io/bash) -t uuid-repo-token 31 | ``` 32 | 33 | 1. More documentation at https://docs.codecov.io 34 | 2. Configure codecov through the `codecov.yml` https://docs.codecov.io/docs/codecov-yaml 35 | 36 | We are happy to help if you have any questions. Please contact email our Support at [support@codecov.io](mailto:support@codecov.io) 37 | 38 | [1]: https://codecov.io/ 39 | [4]: https://github.com/codecov/codecov-python 40 | -------------------------------------------------------------------------------- /hello.f90: -------------------------------------------------------------------------------- 1 | program hello 2 | implicit none 3 | integer :: t 4 | 5 | t = 1 6 | 7 | if (t == 1) then 8 | write(*,*) "on this line" 9 | else 10 | write(*,*) "but not here" 11 | end if 12 | end program 13 | --------------------------------------------------------------------------------