forked from PecanProject/pecan
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.5 KB
/
test.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
name: test
on:
workflow_call:
inputs:
R-version:
required: true
type: string
env:
R_LIBS_USER: /usr/local/lib/R/site-library
LC_ALL: en_US.UTF-8
NCPUS: 2
PGHOST: postgres
CI: true
jobs:
test:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
services:
postgres:
image: mdillon/postgis:9.5
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
container:
image: pecan/depends:R${{ inputs.R-version }}
steps:
# checkout source code
- name: work around https://github.com/actions/checkout/issues/766
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/checkout@v4
with:
set-safe-directory: false
# install additional tools needed
- name: install utils
run: apt-get update && apt-get install -y postgresql-client qpdf
- name: update dependency lists
run: Rscript scripts/generate_dependencies.R
- name: check for out-of-date dependencies files
uses: infotroph/tree-is-clean@v1
- name: install newly-added dependencies
working-directory: docker/depends
run: Rscript pecan.depends.R
# initialize database
- name: db setup
uses: docker://pecan/db:ci
- name: add models to db
run: ./scripts/add.models.sh
# run PEcAn tests
- name: test
run: make -j1 test
- name: check for out-of-date files
uses: infotroph/tree-is-clean@v1