Skip to content

Commit d0c7631

Browse files
committed
Move CI to GitHub Actions
1 parent 3cd92c8 commit d0c7631

File tree

3 files changed

+70
-31
lines changed

3 files changed

+70
-31
lines changed

Diff for: .github/workflows/build-images.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Build Docker Images
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-images:
7+
runs-on: ${{ matrix.os }}
8+
9+
strategy:
10+
matrix:
11+
include:
12+
#VERSIONS
13+
- variant: buster
14+
os: ubuntu-18.04
15+
version: 1.50.0
16+
- variant: buster/slim
17+
os: ubuntu-18.04
18+
version: 1.50.0
19+
- variant: alpine3.12
20+
os: ubuntu-18.04
21+
version: 1.50.0
22+
- variant: alpine3.13
23+
os: ubuntu-18.04
24+
version: 1.50.0
25+
- variant: windowsservercore-1809/msvc
26+
os: windows-2019
27+
version: 1.50.0
28+
#VERSIONS
29+
30+
steps:
31+
- name: Check out repo
32+
uses: actions/checkout@v2
33+
with:
34+
ref: ${{ github.ref }}
35+
- name: Check out Docker official images repo
36+
uses: actions/checkout@v2
37+
with:
38+
repository: docker-library/official-images
39+
path: official-images
40+
- name: Build and test docker image
41+
shell: bash
42+
env:
43+
VERSION: ${{ matrix.version }}
44+
VARIANT: ${{ matrix.variant }}
45+
run: |
46+
env | sort
47+
cd "${VERSION}/${VARIANT}"
48+
slash='/'; image="rust:${VERSION}-${VARIANT//$slash/-}"
49+
docker build -t "$image" .
50+
${GITHUB_WORKSPACE}/official-images/test/run.sh "$image"
51+
docker images

Diff for: .travis.yml

-25
This file was deleted.

Diff for: x.py

+19-6
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,30 @@ def update_windows():
125125
.replace("%%RUSTUP-SHA256%%", rustup_hash_windows("x86_64-pc-windows-msvc"))
126126
write_file(f"{rust_version}/windowsservercore-{version}/msvc/Dockerfile", rendered)
127127

128-
def update_travis():
129-
file = ".travis.yml"
128+
def update_github_actions():
129+
file = ".github/workflows/build-images.yml"
130130
config = read_file(file)
131131

132132
versions = ""
133133
for variant in debian_variants:
134-
versions += f" - VERSION={rust_version} VARIANT={variant}\n"
135-
versions += f" - VERSION={rust_version} VARIANT={variant}/slim\n"
134+
versions += f" - variant: {variant}\n"
135+
versions += f" os: ubuntu-18.04\n"
136+
versions += f" version: {rust_version}\n"
137+
138+
versions += f" - variant: {variant}/slim\n"
139+
versions += f" os: ubuntu-18.04\n"
140+
versions += f" version: {rust_version}\n"
136141

137142
for version in alpine_versions:
138-
versions += f" - VERSION={rust_version} VARIANT=alpine{version}\n"
143+
versions += f" - variant: alpine{version}\n"
144+
versions += f" os: ubuntu-18.04\n"
145+
versions += f" version: {rust_version}\n"
146+
147+
for version, build in windows_servercore_versions:
148+
versions += f" - variant: windowsservercore-{version}/msvc\n"
149+
versions += f" os: windows-2019\n"
150+
versions += f" version: {rust_version}\n"
151+
139152

140153
marker = "#VERSIONS\n"
141154
split = config.split(marker)
@@ -233,8 +246,8 @@ def usage():
233246
if task == "update":
234247
update_debian()
235248
update_alpine()
236-
update_travis()
237249
update_windows()
250+
update_github_actions()
238251
elif task == "generate-stackbrew-library":
239252
generate_stackbrew_library()
240253
else:

0 commit comments

Comments
 (0)