Skip to content

Commit

Permalink
Merge pull request #347 from lucab/ups/gh-actions
Browse files Browse the repository at this point in the history
ci: add initial GitHub workflow
  • Loading branch information
Luca Bruno committed Nov 17, 2020
2 parents 408310d + c9d4a60 commit c9fea21
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 4 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: Go
on:
push:
branches: [master]
pull_request:
branches: [master]

env:
# Minimum supported Go toolchain
ACTION_MINIMUM_TOOLCHAIN: "1.12"

jobs:
build:
name: "Build"
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
go: ['1.14', '1.15']
steps:
- name: Install libsystemd-dev
run: sudo apt-get install libsystemd-dev
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
- name: Go fmt
run: ./scripts/travis/pr-test.sh go_fmt
- name: Go build (source)
run: ./scripts/travis/pr-test.sh build_source
- name: Go build (tests)
run: ./scripts/travis/pr-test.sh build_tests
- name: Go vet
run: ./scripts/travis/pr-test.sh go_vet
build-minimum:
name: "Build on minimum supported toolchain"
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Install libsystemd-dev
run: sudo apt-get install libsystemd-dev
- uses: actions/checkout@v2
- name: Setup go
uses: actions/setup-go@v1
with:
go-version: ${{ env['ACTION_MINIMUM_TOOLCHAIN'] }}
- name: Go fmt
run: ./scripts/travis/pr-test.sh go_fmt
- name: Go build (source)
run: ./scripts/travis/pr-test.sh build_source
- name: Go build (tests)
run: ./scripts/travis/pr-test.sh build_tests
- name: Go vet
run: ./scripts/travis/pr-test.sh go_vet
4 changes: 0 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ install:
- docker run --shm-size=2gb -d --cidfile=/tmp/cidfile --privileged -e GOPATH=${GOPATH} -v ${PWD}:${BUILD_DIR} go-systemd/container-tests /bin/systemd --system

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

after_script:
Expand Down

0 comments on commit c9fea21

Please sign in to comment.