From 6baca72c4dc6e2ab6ca6cb129dc37f087a322a3b Mon Sep 17 00:00:00 2001 From: namusyaka Date: Mon, 16 Nov 2020 12:47:55 +0900 Subject: [PATCH] Migrate CI from travis ci to github actions (#1355) Ref #1352 --- .github/workflows/test.yml | 47 +++++++++++++++++++++++++++++ .travis.yml | 52 --------------------------------- script/generate-bintray-json.sh | 17 ++++++----- script/sync-docs.sh | 8 +---- script/test_in_openshift/run.sh | 2 +- 5 files changed, 59 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..c6f9c40e --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: Kompose CI +on: push +env: + # Avoid noisy outputs like "tput: No value for $TERM and no -T specified" + TERM: dumb +jobs: + test: + name: Test with ${{ matrix.go }} and CROSS_COMPILE=${{ matrix.cross_compile }} + runs-on: ubuntu-18.04 + strategy: + matrix: + go: [1.13, 1.14] + cross_compile: [true, false] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go }} + - name: Install dependencies + run: go get golang.org/x/lint/golint + - name: Build a binary + run: make bin + - name: Run tests + run: make test + - name: Perform cross compile + if: ${{ matrix.cross_compile }} + run: make cross + docs: + name: Build docs and Coveralls integration + runs-on: ubuntu-18.04 + needs: test + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: 1.14 + - name: Install dependencies + run: make test-dep + - name: Collect all .coverprofile files and save it to one file gover.coverprofile + run: gover + - name: Send coverage + run: goveralls -coverprofile=gover.coverprofile -service=github + env: + # As per https://github.com/mattn/goveralls#github-actions + COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: ./script/sync-docs.sh + if: ${{ github.ref == 'refs/heads/master' }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ec80628d..00000000 --- a/.travis.yml +++ /dev/null @@ -1,52 +0,0 @@ -# we need trusty because test-cmd depends on jq version >= 1.5 -dist : trusty -sudo: required - -language: go - -# make this also work for forks -go_import_path: github.com/kubernetes/kompose - -matrix: - include: - - go: "1.13" - env: - # Only build docs once - - BUILD_DOCS=yes - # Test cross-compile as well - - CROSS_COMPILE=yes - - go: "1.14" - -install: - - true - # This is required because sometimes Travis ends up in a detached HEAD state after git clone - - script/test/cmd/fix_detached_head.sh - -script: - - make bin - - make test - # Only cross-compile once - - if [ "$CROSS_COMPILE" == "yes" ]; then make cross; fi - -after_success: - # gover collects all .coverprofile files and saves it to one file gover.coverprofile - - gover - - goveralls -coverprofile=gover.coverprofile -service=travis-ci - # sync the docs only if everything else was successful - - ./script/sync-docs.sh - -before_deploy: - - make cross - - ./script/generate-bintray-json.sh - -deploy: - provider: bintray - repo: kompose/kompose - file: ./.bintray.json - user: - secure: "dAbxiVGW5eGlnSU5CgYkNnCncWembkqWKne1SG7gS0vIUr8Qt61VwTeJ8vC14QzVmLoO1iJB+qiBcdASrGtzma95aaIAuoNFapc3Oubou6UDRQ7lA+mWBflVKGY4Oo7gcSSEtFaxhJApdkfK+cuEih2ekUS2UxL3A2kVkDNzdVreFuRI6Lr8RjNpqDjRSxjjDTBPFsjSwvq4gWyfAwoYvIyg67OCpz09BxQI+wcInuZgXd2uecq6QucSE7fTsZeqEHIjS3NormlWkKhZrQJrrAHVcr0p3EqVF0lfV1LjlQ7MkjcEsF4jxm+ggOGPs3UbrqDvW5XJBlb7Fi+0bdU+k2IcF5vbl17TbhmVHrdCZC0hLrmv+LF3E/Hx3Evv3lNTIS8Jrdn0k2Sbxdu7tSonN+vXtNEbtsUPehfEMDFjGtzFbLxdyhuq1das4dNwCrzM3UPSwF5ZGMQ/bC+H3nIWYenVHjry6F5Po+M6G8rt2GwVURPDbBqBFP2obQOeoAMm/wXgBkFf2uIDZ5aOHFlib8SiPLVve1W4qHmwCJ/iToGcFWZk8clVhBJAMBp1vW/5W5uEdxnzO5tiVdpHGWebhNKHi0kssCyUOpnj+rcuT7EhCEwzWIhyRxKpvC0KAQfoUJkZ3fb+FGmgCw5dpXkj8/DlXhDBv52ySWbT5PUmKwY=" - key: - secure: "JPPfZgbC3h+KuuQsNH21owvV773Ecpj1AUTy54maToLBChnL54WbkFrmb2yzGYBy3LDSznKCet6S1UZj7iWvrrkYw0fSJhR0ICeDt5cxxg6R8zO4DwsiCeSWSlwnOyFjsaweg7lNI35NvlmtBa21uoP4WZl5zaur+mV49jf8JTYQe2BcUQGq1C+olEXiEv8hMRjWW2N5WGkoJHGovX0NbVbiI/S06vdTmlGFBvfL0ZOOvH7sesGkRk4Gqie61pinsQQKxiz6OETCk8E0dQUP9C3o+ZsiiwSrL/und3RoYLyqb4WKzjqDUPxFfgtWLegIVkhp5/KZywJDUQnQ5h2bSbRHakkrZPu9tFgb9nMQjMa5az5WEaJe3nErFfq6B1fawcCvXkUHrujHETEW56PgR1gENkdxD8us/N4897wtCHOJutBav9V8Wb11PSNJupNR7Ta2+gBVG/pHJP3G9/PrrNopDZf5epyP0DU8bKDYTV8YEJU4rv/BGMqYsShrH5abxB4ofk1hmTg9PQFl/k4tVjlutT8W5Y8Hmjmhgmb4UC1Zy4XaVGWIo3ts5vWWj93KWeCyOm+oSSGbvItT5eT7FMMs2RQHFZ8CDfDpTLqmqMBMwZfF7laL4z4imi2XuEgxSbWTlXCkfxpZaFaWixN2MO1rkg6AzklP2ztvXp1j3eg=" - skip_cleanup: true - on: - go: 1.8 diff --git a/script/generate-bintray-json.sh b/script/generate-bintray-json.sh index 288f0eaa..ce532eb8 100755 --- a/script/generate-bintray-json.sh +++ b/script/generate-bintray-json.sh @@ -3,6 +3,9 @@ DATE=`date --iso-8601=date` TIME=`date --iso-8601=seconds` +# GITHUB_PULL_REQUEST MUST be set by your own hands. +# See: https://github.com/actions/checkout/issues/58 + cat > "./.bintray.json" < "./.bintray.json" < "./.bintray.json" <