-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (42 loc) · 1.51 KB
/
docker-image.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
name: Docker Image CI
on: [push, pull_request]
jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository 🛎️
uses: actions/checkout@v3
- name: Install Python 3.9 🐍
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Set up runner 📦
run: pip3 install black==24.4.2
- name: "Black: Code Formatting 👮🏽♀️"
run: black --diff . && black -v --check .
base_image:
name: Base Image for standard environment
runs-on: ubuntu-latest
needs: linting
steps:
- name: Checkout Repository 🛎️
uses: actions/checkout@v3
- name: Create tag name 🆔
run: echo "DOCKER_TAG=$(echo "${{ github.ref_name }}" | sed -E 's/[^[:alnum:].-]+/-/g' | sed -E 's/^[^[:alnum:]]+//')" >> $GITHUB_ENV
- name: docker
run: docker build -t ${DOCKER_TAG} -f environments/Dockerfile .
- name: Pytest
run: docker run ${DOCKER_TAG} pytest
base_image_gpu:
name: Base Image for GPU environment
runs-on: ubuntu-latest
needs: linting
steps:
- name: Checkout Repository 🛎️
uses: actions/checkout@v3
- name: Create tag name 🆔
run: echo "DOCKER_TAG=$(echo "${{ github.ref_name }}-gpu" | sed -E 's/[^[:alnum:].-]+/-/g' | sed -E 's/^[^[:alnum:]]+//')" >> $GITHUB_ENV
- name: docker
run: docker build -t ${DOCKER_TAG} -f environments/Dockerfile.gpu .
- name: Pytest
run: docker run ${DOCKER_TAG} pytest