Layotto Release Pipeline 🌊 #45
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Layotto Release Pipeline 🌊 | |
on: | |
create | |
jobs: | |
style-check: | |
name: "Go Style Check" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.1 | |
- name: Format Go | |
run: | | |
make workspace | |
resolve-modules: | |
name: "Resolve Go Modules" | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- name: Checkout Sources | |
uses: actions/checkout@v2 | |
- id: set-matrix | |
run: sh ./etc/script/resolve-modules.sh | |
golangci-lint: | |
name: "Go CI Linter" | |
needs: [ style-check,resolve-modules ] | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: ${{ fromJson(needs.resolve-modules.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18.5 | |
- name: Go Lint Test | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
version: v1.46.2 | |
working-directory: ${{ matrix.workdir }} | |
args: "--out-${NO_FUTURE}format colored-line-number" | |
go-unit-test: | |
name: "Go Unit Test" | |
needs: [style-check] | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18.1 | |
- name: Go Unit Test | |
run: make test | |
coverage: | |
name: "Coverage Analysis" | |
needs: [go-unit-test,golangci-lint,style-check] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Test Coverage | |
run: make coverage | |
- name: Post Coverage | |
run: bash <(curl -s https://codecov.io/bash) | |
wasm-integrate: | |
name: "Integrate with WASM" | |
needs: [coverage] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.1 | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Run Integrate tests | |
run: make integrate-wasm | |
runtime-integrate: | |
name: "Integrate with Runtime" | |
needs: [coverage] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.1 | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Run Integrate tests | |
run: make integrate-runtime | |
build-binary-darwin-amd64-artifact: | |
name: "Darwin AMD64 Artifact" | |
needs: [runtime-integrate,wasm-integrate] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.1 | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Build Artifact | |
run: | | |
make go.build.darwin_amd64.layotto | |
- name: Publish Artifact | |
uses: actions/upload-artifact@v2.2.4 | |
with: | |
name: layotto.darwin_amd64 | |
path: _output/darwin/amd64/layotto | |
retention-days: 5 | |
if-no-files-found: error | |
- name: Compress Artifact | |
run: zip layotto.darwin_amd64.zip layotto | |
working-directory: _output/darwin/amd64 | |
- name: Upload Artifact to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: _output/darwin/amd64/layotto.darwin_amd64.zip | |
tag: ${{ github.ref }} | |
build-binary-darwin-arm64-artifact: | |
name: "Darwin ARM64 Artifact" | |
needs: [runtime-integrate,wasm-integrate] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.1 | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Build Artifact | |
run: | | |
make go.build.darwin_arm64.layotto | |
- name: Publish Artifact | |
uses: actions/upload-artifact@v2.2.4 | |
with: | |
name: layotto.darwin_arm64 | |
path: _output/darwin/arm64/layotto | |
retention-days: 5 | |
if-no-files-found: error | |
- name: Compress Artifact | |
run: zip layotto.darwin_arm64.zip layotto | |
working-directory: _output/darwin/arm64 | |
- name: Upload Artifact to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: _output/darwin/arm64/layotto.darwin_arm64.zip | |
tag: ${{ github.ref }} | |
build-binary-linux-amd64-artifact: | |
name: "Linux AMD64 Artifact" | |
needs: [runtime-integrate,wasm-integrate] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.1 | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Build Artifact | |
run: | | |
make go.build.linux_amd64.layotto | |
- name: Publish Artifact | |
uses: actions/upload-artifact@v2.2.4 | |
with: | |
name: layotto.linux_amd64 | |
path: _output/linux/amd64/layotto | |
retention-days: 5 | |
if-no-files-found: error | |
- name: Compress Artifact | |
run: zip layotto.linux_amd64.zip layotto | |
working-directory: _output/linux/amd64 | |
- name: Upload Artifact to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: _output/linux/amd64/layotto.linux_amd64.zip | |
tag: ${{ github.ref }} | |
build-binary-linux-arm64-artifact: | |
name: "Linux ARM64 Artifact" | |
needs: [runtime-integrate,wasm-integrate] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.1 | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Build Artifact | |
run: | | |
make go.build.linux_arm64.layotto | |
- name: Publish Artifact | |
uses: actions/upload-artifact@v2.2.4 | |
with: | |
name: layotto.linux_arm64 | |
path: _output/linux/arm64/layotto | |
retention-days: 5 | |
if-no-files-found: error | |
- name: Compress Artifact | |
run: zip layotto.linux_arm64.zip layotto | |
working-directory: _output/linux/arm64 | |
- name: Upload Artifact to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: _output/linux/arm64/layotto.linux_arm64.zip | |
tag: ${{ github.ref }} | |
build-wasm-binary-linux-amd64-artifact: | |
name: "Linux AMD64 WASM Artifact" | |
needs: [wasm-integrate] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.18.1 | |
- name: Check out code | |
uses: actions/checkout@v2 | |
# TODO(@Xunzhuo): open it after stabilizing wasm cmds | |
# - name: Build Artifact | |
# run: | | |
# make wasm | |
# - name: Publish Artifact | |
# uses: actions/upload-artifact@v2.2.4 | |
# with: | |
# name: layotto.wasm.linux_amd64 | |
# path: _output/linux/amd64/layotto | |
# retention-days: 5 | |
# if-no-files-found: error | |
# - name: Compress Artifact | |
# run: zip layotto.wasm.linux_amd64.zip layotto | |
# working-directory: _output/linux/amd64 | |
# - name: Upload Artifact to Release | |
# uses: svenstaro/upload-release-action@v2 | |
# with: | |
# repo_token: ${{ secrets.GITHUB_TOKEN }} | |
# file: _output/linux/amd64/layotto.wasm.linux_amd64.zip | |
# tag: ${{ github.ref }} | |
build-push-wasm-image: | |
name: "Linux AMD64 WASM Image" | |
needs: [build-wasm-binary-linux-amd64-artifact,build-binary-linux-arm64-artifact,build-binary-linux-amd64-artifact,build-binary-darwin-amd64-artifact,build-binary-darwin-arm64-artifact] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
# TODO(@Xunzhuo): open it after stabilizing wasm cmds | |
# - name: Login to DockerHub | |
# uses: docker/login-action@v1 | |
# with: | |
# username: ${{ secrets.DOCKERHUB_USERNAME }} | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# - name: Build Layotto Latest Image | |
# run: | | |
# make wasm.image | |
# - name: Push Image to DockerHub | |
# run: | | |
# make wasm.image.push | |
build-push-linux-amd64-image: | |
name: "Linux AMD64 Image" | |
needs: [build-wasm-binary-linux-amd64-artifact,build-binary-linux-arm64-artifact,build-binary-linux-amd64-artifact,build-binary-darwin-amd64-artifact,build-binary-darwin-arm64-artifact] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build Layotto Latest Image | |
run: | | |
make image.build.linux_amd64.layotto | |
- name: Push Image to DockerHub | |
run: | | |
make image.push.linux_amd64.layotto | |
- name: Build Layotto Injector Latest Image | |
run: | | |
make image.build.linux_amd64.layotto_injector | |
- name: Push Layotto Injector Latest Image to DockerHub | |
run: | | |
make image.push.linux_amd64.layotto_injector | |
build-push-linux-arm64-image: | |
name: "Linux ARM64 Image" | |
needs: [build-wasm-binary-linux-amd64-artifact,build-binary-linux-arm64-artifact,build-binary-linux-amd64-artifact,build-binary-darwin-amd64-artifact,build-binary-darwin-arm64-artifact] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build Layotto Latest Image | |
run: | | |
make image.build.linux_arm64.layotto | |
- name: Push Image to DockerHub | |
run: | | |
make image.push.linux_arm64.layotto | |
- name: Build Layotto Injector Latest Image | |
run: | | |
make image.build.linux_arm64.layotto_injector | |
- name: Push Layotto Injector Latest Image to DockerHub | |
run: | | |
make image.push.linux_arm64.layotto_injector | |
package-push-injector-helm-chart: | |
name: "Layotto Injector Helm Chart" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Package and Push Injector Latest Helm Chart | |
run: | | |
make helm-package | |
make helm-push |