From c9d4a60d7b3e9f6cfe0ea3a64157b2f5318df325 Mon Sep 17 00:00:00 2001 From: Luca BRUNO Date: Tue, 17 Nov 2020 12:14:59 +0000 Subject: [PATCH] ci: add initial GitHub workflow --- .github/workflows/go.yml | 56 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 4 --- 2 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 00000000..67a8b004 --- /dev/null +++ b/.github/workflows/go.yml @@ -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 diff --git a/.travis.yml b/.travis.yml index 32f81e76..150de4e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: