Skip to content

Commit c41f0b8

Browse files
committed
update ci.yml v1
1 parent b871ea3 commit c41f0b8

File tree

1 file changed

+19
-46
lines changed

1 file changed

+19
-46
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,72 @@
1-
name: CI
1+
name: CLARITE CI (Python + R)
22

33
on:
44
push:
5-
branches:
6-
- master
5+
branches: [master]
76
pull_request:
8-
branches:
9-
- master
7+
branches: [master]
108

119
jobs:
12-
13-
CI_Pipeline:
10+
test:
1411
runs-on: ubuntu-latest
1512

13+
strategy:
14+
matrix:
15+
python-version: ["3.10", "3.11", "3.12"]
16+
1617
env:
1718
R_LIBS_USER: ./r-libs
1819

1920
steps:
20-
# - uses: actions/checkout@v1
2121
- uses: actions/checkout@v2
22-
with:
23-
fetch-depth: 1
2422

25-
- name: Make R lib folder if it doesn't exist
26-
run: mkdir -p ${{ env.R_LIBS_USER }}
27-
28-
- name: Cache R packages
29-
uses: actions/cache@v2
30-
id: cache-r
31-
with:
32-
path: ${{ env.R_LIBS_USER }}
33-
key: ${{ runner.os }}-renv-${{ hashFiles('**/survey/DESCRIPTION') }}
34-
35-
- name: Install R packages
36-
shell: Rscript {0}
37-
run: install.packages("survey")
38-
if: steps.cache-r.outputs.cache-hit != 'true'
23+
- name: Install R and survey package
24+
run: |
25+
sudo apt update
26+
sudo apt install -y r-base
27+
Rscript -e 'install.packages("survey", repos="https://cloud.r-project.org")'
3928
4029
- name: Set up Python
4130
uses: actions/setup-python@v2
4231
with:
43-
# python-version: 3.7
44-
python-version: '3.9'
32+
python-version: ${{ matrix.python-version }}
4533

4634
- name: Install Poetry
47-
# uses: snok/[email protected]
4835
uses: snok/install-poetry@v1
4936
with:
5037
version: 1.5.1
5138
virtualenvs-create: true
5239
virtualenvs-in-project: true
5340

54-
#----------------------------------------------
55-
# load cached venv if cache exists
56-
#----------------------------------------------
5741
- name: Load cached venv
5842
id: cached-poetry-dependencies
5943
uses: actions/cache@v2
6044
with:
6145
path: .venv
62-
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
63-
#----------------------------------------------
64-
# install dependencies if cache does not exist
65-
#----------------------------------------------
66-
- name: Install dependencies
46+
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
47+
48+
- name: Install dependencies (if cache miss)
6749
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
6850
run: poetry install --no-interaction --no-root
6951

70-
#----------------------------------------------
71-
# install your root project, if required
72-
#----------------------------------------------
7352
- name: Install library
7453
run: poetry install --no-interaction
7554

76-
#----------------------------------------------
77-
# Activate Env
78-
#----------------------------------------------
79-
8055
- name: Code Quality
8156
run: |
8257
source .venv/bin/activate
8358
black . --check
8459
8560
- name: Test with pytest
86-
run: |
61+
run: |
8762
source .venv/bin/activate
8863
pytest -n 2 --cov . --cov-report=xml
8964
9065
- name: Upload coverage to Codecov
91-
uses: codecov/codecov-action@v1
66+
uses: codecov/codecov-action@v3
9267
with:
9368
file: ./coverage.xml
9469
flags: unittests
95-
env_vars: OS,PYTHON
9670
name: codecov-umbrella
9771
fail_ci_if_error: true
98-
path_to_write_report: ./codecov_report.gz
9972
verbose: true

0 commit comments

Comments
 (0)