-
Notifications
You must be signed in to change notification settings - Fork 16
91 lines (77 loc) · 2.44 KB
/
docker-build-n-test.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
91
name: Build 🛠️ and test 🧪 jupyter-quant Docker Image and pypi package 📦
on:
workflow_dispatch:
push:
branches: [ "master", "dev" ]
pull_request:
branches: [ "master" ]
env:
IMAGE_NAME: gnzsnz/jupyter-quant
GH_IMAGE_NAME: ghcr.io/quantbelt/jupyter-quant
PLATFORMS: linux/amd64,linux/arm64
PACKAGE_NAME: jupyter-quant
jobs:
py_build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
python -m pip install --user -U build pip setuptools wheel
- name: Build a binary wheel and a source tarball
run: python3 -m build
docker_buildntest:
name: Build and test
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get enviroment variables
run: |
grep -v '#' .env-dist | grep '=' > .env
while IFS= read -r line; do
echo $line >> $GITHUB_ENV ;
done < .env
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ env.PLATFORMS }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.IMAGE_NAME }}
${{ env.GH_IMAGE_NAME }}
flavor: |
latest=true
- name: Build Docker image
uses: docker/build-push-action@v6
with:
push: false
load: false
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
platforms: ${{ env.PLATFORMS }}
build-args: |
USER=${{ env.USER }}
USER_ID=${{ env.USER_ID }}
USER_GID=${{ env.USER_GID }}
IMG_PYTHON_VERSION=${{ env.IMG_PYTHON_VERSION}}
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION }}
labels: ${{ steps.meta.outputs.labels }}