Spaces:
Sleeping
Sleeping
MilesCranmer
commited on
Commit
•
00ab5ac
1
Parent(s):
6e2fc47
Create integration test for static libpython linking
Browse files
.github/workflows/CI_conda.yml
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
strategy:
|
29 |
+
matrix:
|
30 |
+
julia-version: ['1.5.0', '1.6.1', '1.7.1']
|
31 |
+
python-version: ['3.7', '3.8', '3.9']
|
32 |
+
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
|
33 |
+
|
34 |
+
steps:
|
35 |
+
- uses: actions/[email protected]
|
36 |
+
- name: "Set up Julia"
|
37 |
+
uses: julia-actions/[email protected]
|
38 |
+
with:
|
39 |
+
version: ${{ matrix.julia-version }}
|
40 |
+
- name: "Change package server"
|
41 |
+
shell: bash
|
42 |
+
env:
|
43 |
+
JULIA_PKG_SERVER: ""
|
44 |
+
run: |
|
45 |
+
julia -e 'using Pkg; Pkg.Registry.add("General")'
|
46 |
+
- name: "Cache dependencies"
|
47 |
+
uses: actions/cache@v1 # Thanks FromFile.jl
|
48 |
+
env:
|
49 |
+
cache-name: cache-artifacts
|
50 |
+
with:
|
51 |
+
path: ~/.julia/artifacts
|
52 |
+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
|
53 |
+
restore-keys: |
|
54 |
+
${{ runner.os }}-build-${{ env.cache-name }}-
|
55 |
+
${{ runner.os }}-build-
|
56 |
+
${{ runner.os }}-
|
57 |
+
- name: "Set up Conda"
|
58 |
+
uses: conda-incubator/setup-miniconda@v2
|
59 |
+
with:
|
60 |
+
auto-activate-base: true
|
61 |
+
auto-update-conda: true
|
62 |
+
channels: conda-forge
|
63 |
+
python-version: ${{ matrix.python-version }}
|
64 |
+
- name: "Install PySR"
|
65 |
+
run: |
|
66 |
+
python -m pip install --upgrade pip
|
67 |
+
conda install -c conda-forge $(cat requirements.txt | grep -v "julia" | xargs echo | sed "s/_/-/g")
|
68 |
+
pip install .
|
69 |
+
python -c 'import pysr; pysr.install()'
|
70 |
+
- name: "Install Coverage tool"
|
71 |
+
run: pip install coverage coveralls
|
72 |
+
- name: "Run tests"
|
73 |
+
run: coverage run --source=pysr --omit='*/feynman_problems.py' -m unittest test.test
|
74 |
+
shell: bash
|
75 |
+
- name: Coveralls
|
76 |
+
env:
|
77 |
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
78 |
+
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
|
79 |
+
COVERALLS_PARALLEL: true
|
80 |
+
run: coveralls --service=github
|
81 |
+
coveralls:
|
82 |
+
name: Indicate completion to coveralls.io
|
83 |
+
needs: test
|
84 |
+
runs-on: ubuntu-latest
|
85 |
+
container: python:3-slim
|
86 |
+
steps:
|
87 |
+
- name: Finished
|
88 |
+
env:
|
89 |
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
90 |
+
run: |
|
91 |
+
pip install coveralls
|
92 |
+
coveralls --finish
|