Bump actions/setup-python from 4 to 5 (#364) #127
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
- name: clone ocs | |
uses: actions/checkout@v4 | |
# Fetch all history for all tags and branches | |
with: | |
fetch-depth: 0 | |
# Dockerize | |
- name: Build all docker images | |
run: | | |
docker-compose build | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.REGISTRY_USER }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Build and push test docker images | |
env: | |
DOCKERHUB_ORG: "simonsobs" | |
run: | | |
export DOCKER_TAG=`git describe --tags --always` | |
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 and set to 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@v5 | |
with: | |
python-version: 3.8 | |
- name: clone ocs | |
uses: actions/checkout@v4 | |
- 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/ocs*.whl | |
- name: install testing requirements | |
run: | | |
pip3 install -r requirements/testing.txt | |
- name: Run unit tests | |
working-directory: ./tests | |
run: | | |
python3 -m pytest -m 'not integtest' |