Skip to content

Commit c9fea21

Browse files
author
Luca Bruno
authored
Merge pull request #347 from lucab/ups/gh-actions
ci: add initial GitHub workflow
2 parents 408310d + c9d4a60 commit c9fea21

File tree

2 files changed

+56
-4
lines changed

2 files changed

+56
-4
lines changed

.github/workflows/go.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: Go
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
env:
10+
# Minimum supported Go toolchain
11+
ACTION_MINIMUM_TOOLCHAIN: "1.12"
12+
13+
jobs:
14+
build:
15+
name: "Build"
16+
runs-on: ubuntu-latest
17+
continue-on-error: true
18+
strategy:
19+
matrix:
20+
go: ['1.14', '1.15']
21+
steps:
22+
- name: Install libsystemd-dev
23+
run: sudo apt-get install libsystemd-dev
24+
- uses: actions/checkout@v2
25+
- name: Setup go
26+
uses: actions/setup-go@v1
27+
with:
28+
go-version: ${{ matrix.go }}
29+
- name: Go fmt
30+
run: ./scripts/travis/pr-test.sh go_fmt
31+
- name: Go build (source)
32+
run: ./scripts/travis/pr-test.sh build_source
33+
- name: Go build (tests)
34+
run: ./scripts/travis/pr-test.sh build_tests
35+
- name: Go vet
36+
run: ./scripts/travis/pr-test.sh go_vet
37+
build-minimum:
38+
name: "Build on minimum supported toolchain"
39+
runs-on: ubuntu-latest
40+
continue-on-error: true
41+
steps:
42+
- name: Install libsystemd-dev
43+
run: sudo apt-get install libsystemd-dev
44+
- uses: actions/checkout@v2
45+
- name: Setup go
46+
uses: actions/setup-go@v1
47+
with:
48+
go-version: ${{ env['ACTION_MINIMUM_TOOLCHAIN'] }}
49+
- name: Go fmt
50+
run: ./scripts/travis/pr-test.sh go_fmt
51+
- name: Go build (source)
52+
run: ./scripts/travis/pr-test.sh build_source
53+
- name: Go build (tests)
54+
run: ./scripts/travis/pr-test.sh build_tests
55+
- name: Go vet
56+
run: ./scripts/travis/pr-test.sh go_vet

.travis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ install:
3333
- docker run --shm-size=2gb -d --cidfile=/tmp/cidfile --privileged -e GOPATH=${GOPATH} -v ${PWD}:${BUILD_DIR} go-systemd/container-tests /bin/systemd --system
3434

3535
script:
36-
- ./scripts/travis/pr-test.sh go_fmt
37-
- ./scripts/travis/pr-test.sh build_source
38-
- ./scripts/travis/pr-test.sh build_tests
3936
- docker exec --privileged `cat /tmp/cidfile` /bin/bash -c "cd ${BUILD_DIR} && ./scripts/travis/pr-test.sh run_tests"
40-
- ./scripts/travis/pr-test.sh go_vet
4137
- ./scripts/travis/pr-test.sh license_check
4238

4339
after_script:

0 commit comments

Comments
 (0)