Skip to content

Commit bbf7d3e

Browse files
committed
Move CI to GitHub Actions
1 parent fea3711 commit bbf7d3e

File tree

3 files changed

+70
-31
lines changed

3 files changed

+70
-31
lines changed

.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

.travis.yml

-25
This file was deleted.

x.py

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

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

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

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

139152
marker = "#VERSIONS\n"
140153
split = config.split(marker)
@@ -232,8 +245,8 @@ def usage():
232245
if task == "update":
233246
update_debian()
234247
update_alpine()
235-
update_travis()
236248
update_windows()
249+
update_github_actions()
237250
elif task == "generate-stackbrew-library":
238251
generate_stackbrew_library()
239252
else:

0 commit comments

Comments
 (0)