[pre-commit.ci] pre-commit autoupdate #880
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: CI | |
on: | |
push: | |
branches: "*" | |
pull_request: | |
branches: "*" | |
jobs: | |
test: | |
name: ${{ matrix.python-version }}-build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8] | |
steps: | |
- uses: actions/checkout@v2.4.0 | |
- name: Setup Python | |
uses: actions/setup-python@v2.3.1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: x64 | |
- uses: actions/cache@v2.1.7 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- run: | | |
python -m pip install -r dev-requirements.txt | |
python -m pip install --no-deps -e . | |
python -m pip list | |
- name: Running Tests | |
run: | | |
python -m pytest --verbose | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2.4.0 | |
- name: Set the repo hash | |
id: reop_hash | |
run: | | |
echo $(git rev-parse --short ${GITHUB_SHA}) | |
echo "REPO_HASH=$(git rev-parse --short ${GITHUB_SHA})" >> $GITHUB_ENV | |
- name: Docker meta | |
id: docker_meta | |
uses: docker/metadata-action@v3.6.0 | |
with: | |
images: | | |
carbonplan/trace-python-notebook | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{major}}.{{minor}}.{{patch}} | |
type=sha | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1.2.0 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1.6.0 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1.12.0 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push | |
uses: docker/build-push-action@v2.7.0 | |
with: | |
context: envs/python-notebook | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.docker_meta.outputs.tags }} | |
labels: ${{ steps.docker_meta.outputs.labels }} | |
cache-from: type=registry,ref=carbonplan/trace-python-notebook:latest | |
build-args: | | |
REPO_HASH=${{ env.REPO_HASH }} |