-
Notifications
You must be signed in to change notification settings - Fork 26
95 lines (87 loc) · 3.22 KB
/
build-test-and-push-windows-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
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
92
93
94
95
name: Build and test devcontainer images
on:
workflow_call:
inputs:
os:
type: string
required: true
description: Image OS
repo:
type: string
required: true
description: Image repo
push:
type: string
required: false
default: false
description: Whether to push the image
features:
type: string
required: true
description: JSON list of devcontainer features
container_env:
type: string
required: false
description: JSON map of default envvars to build into the devcontainer
jobs:
build-test-and-push:
name: ${{ matrix.edition }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- { edition: "2022", runner: "${{ github.repository != 'rapidsai/devcontainers' && 'windows-2022' || 'windows-amd64-cpu4' }}" }
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- id: info
name: Get container info
shell: bash
run: |
repo="${{ inputs.repo }}";
cl="${{ fromJSON(inputs.features)[1].version }}";
cuda="${{ fromJSON(inputs.features)[0].version }}";
version="$(git describe --abbrev=0 --tags | sed 's/[a-zA-Z]//g' | cut -d '.' -f -2)";
tag_without_os="${version}-cuda${cuda}-cl${cl}";
cat <<EOF | tee "$GITHUB_OUTPUT"
cl=${cl}
cuda=${cuda}
repo=${repo,,}
version=${version}
tag_without_os=${tag_without_os}
tag=${tag_without_os}-${{ inputs.os }}${{ matrix.edition }}
EOF
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.GPUCIBOT_DOCKERHUB_USER || vars.DOCKERHUB_USER }}
password: ${{ secrets.GPUCIBOT_DOCKERHUB_TOKEN || secrets.DOCKERHUB_TOKEN }}
- name: Build ${{ steps.info.outputs.tag }}
uses: ./.github/actions/build-windows-image
with:
cl: "${{ steps.info.outputs.cl }}"
tag: "${{ steps.info.outputs.tag }}"
cuda: "${{ steps.info.outputs.cuda }}"
repo: "${{ steps.info.outputs.repo }}"
version: "${{ steps.info.outputs.version }}"
edition: "${{ matrix.edition }}"
- name: Test ${{ steps.info.outputs.tag }}
uses: ./.github/actions/test-windows-image
with:
cl: "${{ steps.info.outputs.cl }}"
tag: "${{ steps.info.outputs.tag }}"
cuda: "${{ steps.info.outputs.cuda }}"
repo: "${{ steps.info.outputs.repo }}"
version: "${{ steps.info.outputs.version }}"
edition: "${{ matrix.edition }}"
- if: inputs.push == 'true'
name: Push ${{ steps.info.outputs.tag }}
shell: powershell
run: |
docker image tag ${{ steps.info.outputs.repo }}:${{ steps.info.outputs.tag }} ${{ steps.info.outputs.repo }}:${{ steps.info.outputs.tag_without_os }}
docker push ${{ steps.info.outputs.repo }}:${{ steps.info.outputs.tag_without_os }}
docker push ${{ steps.info.outputs.repo }}:${{ steps.info.outputs.tag }}