-
Notifications
You must be signed in to change notification settings - Fork 13
90 lines (73 loc) · 2.29 KB
/
develop.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Build Test Images
on:
push:
branches: [ main ]
paths-ignore:
- 'docs/**'
- '**.rst'
- '**.md'
- '.flake8'
- '.pre-commit-config.yaml'
- '.readthedocs.yaml'
jobs:
test:
uses: ./.github/workflows/pytest.yml
build:
name: build and deploy test images
needs: test
runs-on: ubuntu-latest
steps:
# Fetch all history for all tags and branches
- name: clone socs
uses: actions/checkout@v3
with:
fetch-depth: 0
# Dockerize
- name: Build docker images
run: |
docker-compose build
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Tag and push test docker images
env:
DOCKERHUB_ORG: "simonsobs"
run: |
export DOCKER_TAG=`git describe --tags --always`-dev
echo "${DOCKER_TAG}"
# Tag all images for upload to the registry
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker tag {}:latest ${DOCKERHUB_ORG}/{}:${DOCKER_TAG}
# Upload to docker registry
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} docker push ${DOCKERHUB_ORG}/{}:${DOCKER_TAG}
docker-compose config | grep 'image: ' | awk -F ': ' '{ print $2 }' | xargs -I {} echo ${DOCKERHUB_ORG}/{}:${DOCKER_TAG} pushed
# testing so we can catch any issues before release
# if issues are found, test locally, or copy to pytest.yml for test on push
wheel:
name: build and test wheel
needs: test
runs-on: ubuntu-latest
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: clone socs
uses: actions/checkout@v3
- name: install build dependencies
run: |
python3 -m pip install --upgrade build twine
- name: build wheel
run: |
python3 -m build
- name: install wheel
run: |
python3 -m pip install dist/socs*.whl
- name: install requirements for testing
run: |
pip3 install -r requirements.txt
- name: Run unit tests
working-directory: ./tests
run: |
python3 -m pytest -m 'not integtest'