Skip to content

Commit dcc9020

Browse files
pietroalbiniJoshua Nelson
authored and
Joshua Nelson
committed
replace travis with gha
1 parent 28cfbfe commit dcc9020

File tree

8 files changed

+63
-86
lines changed

8 files changed

+63
-86
lines changed

Diff for: .github/workflows/main.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
3+
name: CI
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request: {}
9+
10+
jobs:
11+
lint:
12+
name: Lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout the source code
16+
uses: actions/checkout@v2
17+
18+
- name: Run the custom linter
19+
run: ./lint.sh
20+
21+
build:
22+
name: Build images
23+
runs-on: ubuntu-latest
24+
needs: [lint]
25+
26+
# Use the same job to build all Linux-based images
27+
strategy:
28+
matrix:
29+
image:
30+
- linux
31+
- linux-micro
32+
33+
steps:
34+
- name: Checkout the source code
35+
uses: actions/checkout@v2
36+
37+
- name: Build the Docker image
38+
run: docker build -t ghcr.io/${{ github.repository }}/${{ matrix.image }}:latest ${{ matrix.image }}/
39+
40+
- name: Authenticate with GitHub Container Registry
41+
uses: docker/login-action@v1
42+
with:
43+
registry: ghcr.io
44+
username: ${{ github.repository_owner }}
45+
password: ${{ secrets.GITHUB_TOKEN }}
46+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
47+
48+
- name: Upload the Docker image to GitHub Container Registry
49+
run: docker push ghcr.io/${{ github.repository }}/${{ matrix.image }}:latest
50+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'

Diff for: .travis.yml

-30
This file was deleted.

Diff for: lint.sh

+12-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ set -euo pipefail
33
IFS=$'\n\t'
44
export LC_ALL=C
55

6+
PACKAGES_FILES=(
7+
linux/packages.txt
8+
linux-micro/packages.txt
9+
)
10+
611
# Ensure packages lists are sorted
7-
for file in packages; do
8-
cat "${file}.txt" | sort -u > "/tmp/sorted-${file}.txt"
9-
if ! diff -u "/tmp/sorted-${file}.txt" "${file}.txt"; then
10-
echo "Lint error: ${file}.txt is not sorted"
12+
for file in ${PACKAGES_FILES[@]}; do
13+
# Replace / with - in the file path to avoid creating subdirs.
14+
sorted_file="/tmp/sorted-${file/\//-}"
15+
16+
cat "${file}" | sort -u > "${sorted_file}"
17+
if ! diff -u "${sorted_file}" "${file}"; then
18+
echo "Lint error: ${file} is not sorted"
1119
exit 1
1220
fi
1321
done

Diff for: linux/ci/build.sh

-5
This file was deleted.

Diff for: linux/ci/publish.sh

-27
This file was deleted.

Diff for: windows/Dockerfile

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# escape=`
2-
3-
ARG BASE_IMAGE_VER=:1803
4-
5-
FROM mcr.microsoft.com/windows/servercore${BASE_IMAGE_VER}
2+
FROM mcr.microsoft.com/windows/servercore:ltsc2019
63

74
# Install the Visual C++ Build tools
85
#

Diff for: windows/ci/build.ps1

-6
This file was deleted.

Diff for: windows/ci/publish.ps1

-10
This file was deleted.

0 commit comments

Comments
 (0)