forked from IslasGECI/nerd
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (83 loc) · 3.2 KB
/
actions.yml
File metadata and controls
83 lines (83 loc) · 3.2 KB
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
name: Test and publish
on: push
jobs:
test-module:
name: Test Python module 🐍
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@main
- name: Build Docker image
run: docker build --tag islasgeci/nerd:latest --tag islasgeci/nerd:${GITHUB_SHA:0:4} .
- name: Check format
run: docker run islasgeci/nerd:${GITHUB_SHA:0:4} make check
- name: Test
run: docker run islasgeci/nerd:${GITHUB_SHA:0:4} make coverage
- name: Run mutation testing
run: docker run islasgeci/nerd:${GITHUB_SHA:0:4} make mutants
test-notebook:
name: Test Jupyter notebooks
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@main
- name: Build demo Docker image
run: docker build --file Dockerfile.demo --tag=islasgeci/nerd_demo:latest --tag islasgeci/nerd_demo:${GITHUB_SHA:0:4} .
- name: Check notebook format
run: docker run --volume ${PWD}/Makefile:/workdir/Makefile islasgeci/nerd_demo:${GITHUB_SHA:0:4} make check_notebook
- name: Verify the notebooks run
run: docker --volume ${PWD}/figures:/workdir/figures run --volume ${PWD}/tests/test_notebooks.sh:/workdir/tests/test_notebooks.sh islasgeci/nerd_demo:${GITHUB_SHA:0:4} tests/test_notebooks.sh
- name: Auto-commit paper.md
uses: stefanzweifel/git-auto-commit-action@master
with:
commit_message: 🤖 Apply automatic changes
file_pattern: 'figures/*.png'
commit_user_name: Ciencia de Datos • GECI
commit_user_email: ciencia.datos@islas.org.mx
push:
name: Push module to PyPI and images to Docker Hub
needs: [test-notebook, test-module]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@main
- name: Docker log-in
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
- name: Build Docker image
run: docker build --tag islasgeci/nerd:latest --tag islasgeci/nerd:${GITHUB_SHA:0:4} .
- name: Build demo Docker image
run: docker build --file Dockerfile.demo --tag=islasgeci/nerd_demo:latest --tag islasgeci/nerd_demo:${GITHUB_SHA:0:4} .
- name: Push latest Docker image to Docker Hub
run: docker push islasgeci/nerd:latest
- name: Push SHA tag to Docker Hub
run: docker push islasgeci/nerd:${GITHUB_SHA:0:4}
- name: Push latest demo image to Docker Hub
run: docker push islasgeci/nerd_demo:latest
- name: Push demo SHA to Docker Hub
run: docker push islasgeci/nerd_demo:${GITHUB_SHA:0:4}
- name: Set up Python 3.9
uses: actions/setup-python@main
with:
python-version: 3.9
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_TOKEN }}
skip-existing: true