Skip to content

Commit 978a0e7

Browse files
Try switching CI to running a docker image
1 parent 811bf96 commit 978a0e7

5 files changed

Lines changed: 58 additions & 62 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -6,76 +6,27 @@ on:
66
branches:
77
- master
88
- ci
9+
- ci2
910

1011
pull_request:
1112
branches:
1213
- master
1314

1415
jobs:
15-
doctest-and-lint:
16-
runs-on: ubuntu-20.04
16+
test-and-doctest:
17+
runs-on: ubuntu-24.04
1718
steps:
1819
- uses: actions/checkout@v2
19-
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v2
21-
with:
22-
python-version: 3.6.15
23-
24-
- name: Install pinned dependencies
25-
run: |
26-
python -m pip install --upgrade pip
27-
pip install astropy==3.0.1 docutils==0.17.1 matplotlib==3.3.0 numpy==1.15.4 pandas==1.0.0 pyflakes scipy==1.2.2 sphinx==1.7.2 spktype21
28-
29-
- name: Install Skyfield
30-
run: |
31-
python setup.py sdist
32-
pip install -e .
33-
34-
- name: Doctest
35-
run: |
36-
./test-docs.sh
37-
38-
- name: Lint
39-
run: |
40-
pyflakes $(find skyfield/ -name '*.py')
41-
42-
test:
43-
runs-on: ubuntu-20.04
44-
strategy:
45-
fail-fast: false
46-
matrix:
47-
python: [python2, python3]
20+
- name: Run tests and doctests inside container
21+
run: ./containers/ci/run bash -c './test-code.sh && ./test-docs.sh'
4822

23+
lint:
24+
runs-on: ubuntu-24.04
4925
steps:
5026
- uses: actions/checkout@v2
51-
52-
- name: Install
53-
run: |
54-
sudo apt install -q -q python3-virtualenv virtualenv
55-
virtualenv -p ${{matrix.python}} V
56-
57-
- name: Build scripts
58-
run: |
59-
cat <<'EOF' > GITHUB_INSTALL.sh
60-
source ./V/bin/activate
61-
echo PATH is $PATH
62-
which python
63-
python --version
64-
python -m pip install --upgrade pip
65-
python setup.py sdist
66-
python -m pip install dist/*
67-
python -m pip install mock pandas
68-
python -m pip install https://github.com/brandon-rhodes/assay/archive/master.zip
69-
EOF
70-
cat <<'EOF' > GITHUB_TEST.sh
71-
source ./V/bin/activate
72-
cd ci && ../test-code.sh
73-
EOF
74-
75-
- name: Install
76-
run: |
77-
bash -e -x GITHUB_INSTALL.sh
78-
79-
- name: Test
80-
run: |
81-
bash -e -x GITHUB_TEST.sh
27+
- name: Set up Python
28+
uses: actions/setup-python@v2
29+
- name: Install linter
30+
run: python -m pip install --upgrade pyflakes
31+
- name: Run linter
32+
run: pyflakes $(find skyfield/ -name '*.py')

containers/ci/Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM ubuntu:20.04
2+
COPY sources.list /etc/apt/sources.list
3+
RUN apt update
4+
RUN apt install -y -y curl python3-dev make
5+
RUN curl -LsSf https://astral.sh/uv/0.10.0/install.sh \
6+
| UV_INSTALL_DIR="/usr/local/bin" sh
7+
8+
COPY requirements.txt /root/requirements.txt
9+
RUN uv pip install --system -r /root/requirements.txt
10+
RUN uv pip install --system jplephem sgp4
11+
RUN ln -s /usr/bin/python3 /usr/local/bin/python
12+
13+
WORKDIR /src
14+
ENV PYTHONDONTWRITEBYTECODE PLEASE
15+
ENV PYTHONPATH /src
16+
CMD ["/bin/bash"]

containers/ci/requirements.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
astropy==5.1
2+
beautifulsoup4==4.6.0
3+
html5lib==1.0.1
4+
jinja2==3.0.3
5+
lxml==4.9.1
6+
mock==2.0.0
7+
numpy==1.18.5
8+
matplotlib==3.3.0
9+
pandas==1.3.5
10+
pyflakes==2.1.1
11+
pygments==2.17.2
12+
python-dateutil>=2.5.0
13+
pytz
14+
sphinx==1.7.2
15+
spktype21
16+
https://github.com/brandon-rhodes/assay/archive/master.zip

containers/ci/run

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
name=skyfield-ci
4+
5+
set -e
6+
cd "$(readlink -f $(dirname "${BASH_SOURCE[0]}"))"
7+
podman build -t $name .
8+
exec podman run -it \
9+
-v $PWD/../..:/src \
10+
$name "$@"

containers/ci/sources.list

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
deb http://archive.ubuntu.com/ubuntu/ focal main
2+
deb http://archive.ubuntu.com/ubuntu/ focal-updates main
3+
deb http://security.ubuntu.com/ubuntu/ focal-security main

0 commit comments

Comments
 (0)