MilesCranmer commited on
Commit
099a9c6
1 Parent(s): 000f989

Merge Conda CI to CI.yml

Browse files
.github/workflows/CI.yml CHANGED
@@ -79,12 +79,74 @@ jobs:
79
  - name: Coveralls
80
  env:
81
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82
- COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
83
  COVERALLS_PARALLEL: true
84
  run: coveralls --service=github
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  coveralls:
86
  name: Indicate completion to coveralls.io
87
- needs: test
 
 
88
  runs-on: ubuntu-latest
89
  defaults:
90
  run:
 
79
  - name: Coveralls
80
  env:
81
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82
+ COVERALLS_FLAG_NAME: test-${{ matrix.test-name }}
83
  COVERALLS_PARALLEL: true
84
  run: coveralls --service=github
85
+
86
+ conda_test:
87
+ runs-on: ${{ matrix.os }}
88
+ defaults:
89
+ run:
90
+ shell: bash -l {0}
91
+ strategy:
92
+ matrix:
93
+ julia-version: ['1.7.1']
94
+ python-version: ['3.9']
95
+ os: ['ubuntu-latest']
96
+
97
+ steps:
98
+ - uses: actions/[email protected]
99
+ - name: "Set up Julia"
100
+ uses: julia-actions/[email protected]
101
+ with:
102
+ version: ${{ matrix.julia-version }}
103
+ - name: "Change package server"
104
+ env:
105
+ JULIA_PKG_SERVER: ""
106
+ run: |
107
+ julia -e 'using Pkg; Pkg.Registry.add("General")'
108
+ - name: "Cache dependencies"
109
+ uses: actions/cache@v1 # Thanks FromFile.jl
110
+ env:
111
+ cache-name: cache-artifacts
112
+ with:
113
+ path: ~/.julia/artifacts
114
+ key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
115
+ restore-keys: |
116
+ ${{ runner.os }}-build-${{ env.cache-name }}-
117
+ ${{ runner.os }}-build-
118
+ ${{ runner.os }}-
119
+ - name: "Set up Conda"
120
+ uses: conda-incubator/setup-miniconda@v2
121
+ with:
122
+ miniforge-variant: Mambaforge
123
+ miniforge-version: latest
124
+ auto-activate-base: true
125
+ python-version: ${{ matrix.python-version }}
126
+ activate-environment: test
127
+ environment-file: environment.yml
128
+ - name: "Install PySR"
129
+ run: |
130
+ python3 -m pip install .
131
+ python3 -c 'import pysr; pysr.install()'
132
+ - name: "Install Coverage tool"
133
+ run: python3 -m pip install coverage coveralls
134
+ - name: "Ensure that static libpython warning appears"
135
+ run: coverage run --source=pysr --omit='*/feynman_problems.py' test/test_static_libpython_warning.py
136
+ - name: "Run tests"
137
+ run: coverage run --append --source=pysr --omit='*/feynman_problems.py' -m unittest test.test
138
+ - name: Coveralls
139
+ env:
140
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141
+ COVERALLS_FLAG_NAME: conda-test-${{ matrix.test-name }}
142
+ COVERALLS_PARALLEL: true
143
+ run: coveralls --service=github
144
+
145
  coveralls:
146
  name: Indicate completion to coveralls.io
147
+ needs:
148
+ - test
149
+ - conda_test
150
  runs-on: ubuntu-latest
151
  defaults:
152
  run:
.github/workflows/CI_conda.yml DELETED
@@ -1,96 +0,0 @@
1
- name: CI_conda
2
- # This tests whether conda, a statically-linked libpython, works
3
- # with PySR.
4
-
5
- on:
6
- push:
7
- branches:
8
- - '*'
9
- paths:
10
- - 'test/**'
11
- - 'pysr/**'
12
- - '.github/workflows/**'
13
- - 'setup.py'
14
- - 'Project.toml'
15
- pull_request:
16
- branches:
17
- - '*'
18
- paths:
19
- - 'test/**'
20
- - 'pysr/**'
21
- - '.github/workflows/**'
22
- - 'setup.py'
23
- - 'Project.toml'
24
-
25
- jobs:
26
- test:
27
- runs-on: ${{ matrix.os }}
28
- defaults:
29
- run:
30
- shell: bash -l {0}
31
- strategy:
32
- matrix:
33
- julia-version: ['1.7.1']
34
- python-version: ['3.9']
35
- os: ['ubuntu-latest']
36
-
37
- steps:
38
- - uses: actions/[email protected]
39
- - name: "Set up Julia"
40
- uses: julia-actions/[email protected]
41
- with:
42
- version: ${{ matrix.julia-version }}
43
- - name: "Change package server"
44
- env:
45
- JULIA_PKG_SERVER: ""
46
- run: |
47
- julia -e 'using Pkg; Pkg.Registry.add("General")'
48
- - name: "Cache dependencies"
49
- uses: actions/cache@v1 # Thanks FromFile.jl
50
- env:
51
- cache-name: cache-artifacts
52
- with:
53
- path: ~/.julia/artifacts
54
- key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
55
- restore-keys: |
56
- ${{ runner.os }}-build-${{ env.cache-name }}-
57
- ${{ runner.os }}-build-
58
- ${{ runner.os }}-
59
- - name: "Set up Conda"
60
- uses: conda-incubator/setup-miniconda@v2
61
- with:
62
- miniforge-variant: Mambaforge
63
- miniforge-version: latest
64
- auto-activate-base: true
65
- python-version: ${{ matrix.python-version }}
66
- activate-environment: test
67
- environment-file: environment.yml
68
- - name: "Install PySR"
69
- run: |
70
- python3 -m pip install .
71
- python3 -c 'import pysr; pysr.install()'
72
- - name: "Install Coverage tool"
73
- run: python3 -m pip install coverage coveralls
74
- - name: "Ensure that static libpython warning appears"
75
- run: coverage run --source=pysr --omit='*/feynman_problems.py' test/test_static_libpython_warning.py
76
- - name: "Run tests"
77
- run: coverage run --append --source=pysr --omit='*/feynman_problems.py' -m unittest test.test
78
- - name: Coveralls
79
- env:
80
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81
- COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
82
- COVERALLS_PARALLEL: true
83
- run: coveralls --service=github
84
-
85
- coveralls:
86
- name: Indicate completion to coveralls.io
87
- needs: test
88
- runs-on: ubuntu-latest
89
- container: python:3-slim
90
- steps:
91
- - name: Finished
92
- env:
93
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94
- run: |
95
- pip install coveralls
96
- coveralls --finish