-
Notifications
You must be signed in to change notification settings - Fork 15
105 lines (87 loc) · 3.32 KB
/
pull_request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
## This file is part of coronet, which is free software: you
## can redistribute it and/or modify it under the terms of the GNU General
## Public License as published by the Free Software Foundation, version 2.
##
## This program 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
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License along
## with this program; if not, write to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
##
## Copyright 2023-2024 by Maximilian Löffler <[email protected]>
## Copyright 2024 by Thomas Bock <[email protected]>
## All Rights Reserved.
name: Build Status
on:
pull_request:
branches: [ master, dev ]
types: [ opened, reopened, synchronize ]
push:
branches: [ master, dev ]
permissions:
contents: read
jobs:
build:
name: Build
# change to 'runs-on: self-hosted' to run on self-hosted runners (https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
r-version: ['3.6', '4.0', '4.1', '4.2', '4.3', 'latest']
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Update system
run: |
sudo apt-get update -y
sudo apt-get install --assume-yes libxml2
sudo apt-get install --assume-yes libxml2-dev
sudo apt-get install --assume-yes libglpk-dev
sudo apt-get install --assume-yes libfontconfig1-dev
sudo apt-get install --assume-yes libssl-dev
sudo apt-get install --assume-yes libcurl4-openssl-dev
sudo su -c "echo 'deb https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/' >> /etc/apt/sources.list"
wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | sudo tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
- name: Set up R ${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}
- name: Install dependencies
run: Rscript install.R
- name: Run Tests
id: run_tests
run: Rscript tests.R
- name: Run Showcase
run: Rscript showcase.R
if: always()
- name: Generate Coverage Report
id: gen_coverage
run: Rscript coverage.R
if: matrix.r-version == 'latest' && steps.run_tests.outcome == 'success'
- name: Store coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: cobertura.xml
if: matrix.r-version == 'latest' && steps.gen_coverage.outcome == 'success'
upload-coverage-report:
name: Upload coverage report
needs: build
runs-on: ubuntu-latest
steps:
- name: Load coverage report
uses: actions/download-artifact@v4
with:
name: coverage-report
- name: Upload Report to CodeCov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: cobertura.xml
disable_search: true
fail_ci_if_error: true
verbose: true