From 77c7b44c2c06c0a86ca9fd4910c9a2c5ff72102e Mon Sep 17 00:00:00 2001 From: Akos Veres Date: Thu, 5 Nov 2020 19:54:08 +0000 Subject: [PATCH 1/4] Add build github actions workflow Signed-off-by: Akos Veres --- .github/workflows/build.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..5a7d6904 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,35 @@ +name: build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + env: + GO111MODULE: off + strategy: + matrix: + go-version: [1.13.x] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@master + with: + fetch-depth: 1 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: test + run: make test + - name: dist + run: make dist + - name: prepare-test + run: make prepare-test + - name: test e2e + run: make test-e2e + + From 089e347f58559f2a9f13ef8d4f4718e3cff5341a Mon Sep 17 00:00:00 2001 From: Akos Veres Date: Thu, 5 Nov 2020 19:54:27 +0000 Subject: [PATCH 2/4] Add publish github actions workflow Signed-off-by: Akos Veres --- .github/workflows/publish.yaml | 88 ++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000..282aa077 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,88 @@ +name: publish + +on: + push: + tags: + - '*' + +jobs: + publish: + env: + GO111MODULE: off + strategy: + matrix: + go-version: [1.13.x] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@master + with: + fetch-depth: 1 + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + - name: test + run: make test + - name: dist + run: make dist + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload Release faasd + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./bin/faasd + asset_name: faasd + - name: Upload Release faasd-armhf + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./bin/faasd-armhf + asset_name: faasd-armhf + - name: Upload Release faasd-arm64 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./bin/faasd-arm64 + asset_name: faasd-arm64 + - name: Upload Release faasd.sha256 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./bin/faasd.sha256 + asset_name: faasd.sha256 + - name: Upload Release faasd-armhf.sha256 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./bin/faasd-armhf.sha256 + asset_name: faasd-armhf.sha256 + - name: Upload Release faasd-arm64.sha256 + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./bin/faasd-arm64.sha256 + asset_name: faasd-arm64.sha256 From 2b0c6ae2c6055a82968005f4493e2ebf100e4c63 Mon Sep 17 00:00:00 2001 From: Akos Veres Date: Thu, 5 Nov 2020 20:05:04 +0000 Subject: [PATCH 3/4] Various fixes to make the github actions workflow pass Signed-off-by: Akos Veres --- .github/workflows/build.yaml | 1 + .github/workflows/publish.yaml | 8 ++++++++ Makefile | 6 +++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5a7d6904..98d84539 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,6 +23,7 @@ jobs: uses: actions/setup-go@v2 with: go-version: ${{ matrix.go-version }} + - name: test run: make test - name: dist diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 282aa077..071a8c53 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -26,6 +26,8 @@ jobs: run: make test - name: dist run: make dist + - name: hashgen + run: make hashgen - name: Create Release id: create_release @@ -46,6 +48,7 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ./bin/faasd asset_name: faasd + asset_content_type: application/binary - name: Upload Release faasd-armhf uses: actions/upload-release-asset@v1 env: @@ -54,6 +57,7 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ./bin/faasd-armhf asset_name: faasd-armhf + asset_content_type: application/binary - name: Upload Release faasd-arm64 uses: actions/upload-release-asset@v1 env: @@ -62,6 +66,7 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ./bin/faasd-arm64 asset_name: faasd-arm64 + asset_content_type: application/binary - name: Upload Release faasd.sha256 uses: actions/upload-release-asset@v1 env: @@ -70,6 +75,7 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ./bin/faasd.sha256 asset_name: faasd.sha256 + asset_content_type: text/plain - name: Upload Release faasd-armhf.sha256 uses: actions/upload-release-asset@v1 env: @@ -78,6 +84,7 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ./bin/faasd-armhf.sha256 asset_name: faasd-armhf.sha256 + asset_content_type: text/plain - name: Upload Release faasd-arm64.sha256 uses: actions/upload-release-asset@v1 env: @@ -86,3 +93,4 @@ jobs: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ./bin/faasd-arm64.sha256 asset_name: faasd-arm64.sha256 + asset_content_type: text/plain diff --git a/Makefile b/Makefile index 31d43199..43fe1989 100644 --- a/Makefile +++ b/Makefile @@ -35,8 +35,8 @@ prepare-test: sudo /sbin/sysctl -w net.ipv4.conf.all.forwarding=1 sudo mkdir -p /opt/cni/bin curl -sSL https://github.com/containernetworking/plugins/releases/download/$(CNI_VERSION)/cni-plugins-linux-$(ARCH)-$(CNI_VERSION).tgz | sudo tar -xz -C /opt/cni/bin - sudo cp $(GOPATH)/src/github.com/openfaas/faasd/bin/faasd /usr/local/bin/ - cd $(GOPATH)/src/github.com/openfaas/faasd/ && sudo /usr/local/bin/faasd install + sudo cp bin/faasd /usr/local/bin/ + sudo /usr/local/bin/faasd install sudo systemctl status -l containerd --no-pager sudo journalctl -u faasd-provider --no-pager sudo systemctl status -l faasd-provider --no-pager @@ -58,5 +58,5 @@ test-e2e: /usr/local/bin/faas-cli remove figlet sleep 3 /usr/local/bin/faas-cli list - sleep 1 + sleep 3 /usr/local/bin/faas-cli logs figlet --follow=false | grep Forking From b051c2b35cbf7840b91260710e4125f13db8de42 Mon Sep 17 00:00:00 2001 From: Akos Veres Date: Thu, 5 Nov 2020 21:57:49 +0000 Subject: [PATCH 4/4] Remove travis.yaml and update build status badge Signed-off-by: Akos Veres --- .travis.yml | 37 ------------------------------------- README.md | 2 +- 2 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3e7b012a..00000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -sudo: required -language: go - -go: -- '1.13' - -addons: - apt: - packages: - - runc - -script: -- make test -- make dist -- make prepare-test -- make test-e2e - -before_deploy: - - make hashgen - -deploy: - provider: releases - api_key: - secure: bccOSB+Mbk5ZJHyJfX82Xg/3/7mxiAYHx7P5m5KS1ncDuRpJBFjDV8Nx2PWYg341b5SMlCwsS3IJ9NkoGvRSKK+3YqeNfTeMabVNdKC2oL1i+4pdxGlbl57QXkzT4smqE8AykZEo4Ujk42rEr3e0gSHT2rXkV+Xt0xnoRVXn2tSRUDwsmwANnaBj6KpH2SjJ/lsfTifxrRB65uwcePaSjkqwR6htFraQtpONC9xYDdek6EoVQmoft/ONZJqi7HR+OcA1yhSt93XU6Vaf3678uLlPX9c/DxgIU9UnXRaOd0UUEiTHaMMWDe/bJSrKmgL7qY05WwbGMsXO/RdswwO1+zwrasrwf86SjdGX/P9AwobTW3eTEiBqw2J77UVbvLzDDoyJ5KrkbHRfPX8aIPO4OG9eHy/e7C3XVx4qv9bJBXQ3qD9YJtei9jmm8F/MCdPWuVYC0hEvHtuhP/xMm4esNUjFM5JUfDucvAuLL34NBYHBDP2XNuV4DkgQQPakfnlvYBd7OqyXCU6pzyWSasXpD1Rz8mD/x8aTUl2Ya4bnXQ8qAa5cnxfPqN2ADRlTw1qS7hl6LsXzNQ6r1mbuh/uFi67ybElIjBTfuMEeJOyYHkkLUHIBpooKrPyr0luAbf0By2D2N/eQQnM/RpixHNfZG/mvXx8ZCrs+wxgvG1Rm7rM= - file: - - ./bin/faasd - - ./bin/faasd-armhf - - ./bin/faasd-arm64 - - ./bin/faasd.sha256 - - ./bin/faasd-armhf.sha256 - - ./bin/faasd-arm64.sha256 - skip_cleanup: true - on: - tags: true - -env: GO111MODULE=off - diff --git a/README.md b/README.md index 067517eb..ba86dc10 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # faasd - a lightweight & portable faas engine -[![Build Status](https://travis-ci.com/openfaas/faasd.svg?branch=master)](https://travis-ci.com/openfaas/faasd) +[![Build Status](https://github.com/openfaas/faasd/workflows/build/badge.svg?branch=master)](https://github.com/openfaas/faasd/actions) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![OpenFaaS](https://img.shields.io/badge/openfaas-serverless-blue.svg)](https://www.openfaas.com) ![Downloads](https://img.shields.io/github/downloads/openfaas/faasd/total)