Skip to content

Commit

Permalink
ci: unify build
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed May 11, 2021
1 parent 538a80b commit af2cdbe
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 137 deletions.
124 changes: 124 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Build

on:
push:
tags: [ v* ]
branches: [ main ]
pull_request:
branches: [ main ]

jobs:

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16
- run: go version
- run: go env
- run: make kubebuilder name=linux
- run: go mod download
- run: make test
- run: bash <(curl -s https://codecov.io/bash)

lint:
runs-on: ubuntu-latest
needs: [ test ]
steps:
- uses: actions/checkout@v2
- run: touch api/util/message
- uses: golangci/golangci-lint-action@v2
with:
version: v1.36.0
- run: git diff --exit-code

e2e:
runs-on: ubuntu-latest
needs: [ test ]
env:
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- name: Install and start K3S
timeout-minutes: 3
run: |
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.18.17+k3s1 INSTALL_K3S_CHANNEL=stable INSTALL_K3S_EXEC=--docker K3S_KUBECONFIG_MODE=644 sh -
until kubectl cluster-info ; do sleep 10s ; done
- uses: actions/setup-go@v2
with:
go-version: "1.16.2"
- run: make controller
- run: make deploy CONFIG=ci
- run: make runner runtimes
- run: make wait
- run: make test-examples
- name: list pods
if: ${{ failure() }}
run: kubectl -n argo-dataflow-system get pod
- name: controller logs
if: ${{ failure() }}
run: kubectl -n argo-dataflow-system logs deploy/controller-manager -c manager

publish-images:
runs-on: ubuntu-latest
needs: [ test, lint, e2e ]
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
target: [ controller, runner, go1-16, java16, python3-9 ]
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: docker build + push
run: |
tag=$(basename $GITHUB_REF)
if [ $tag = "master" ]; then
tag="latest"
fi
docker buildx build . --target ${{matrix.target}} --tag quay.io/argoproj/dataflow-${{matrix.target}}:$tag --push
draft-release:
runs-on: ubuntu-latest
needs: [ test, lint, e2e ]
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# 0 indicates all history for all branches and tags.
fetch-depth: 0
# https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
- uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Get tag
run: |
tag=$(basename $GITHUB_REF)
if [ $tag = "master" ]; then
tag="latest"
fi
echo "##[set-output name=tag;]$tag"
id: tag
- name: Generate release artifacts
run: make manifests changelog TAG=${{ github.tag.inputs.tag }}
- name: Draft release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.tag.inputs.tag }}
draft: true
prerelease: true
body_path: changelog
files: |
config/*.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 0 additions & 36 deletions .github/workflows/e2e.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/go.yml

This file was deleted.

65 changes: 0 additions & 65 deletions .github/workflows/release.yml

This file was deleted.

5 changes: 3 additions & 2 deletions controllers/suite_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package controllers

import (
"github.com/argoproj-labs/argo-dataflow/api/util/containerkiller"
"k8s.io/client-go/kubernetes"
"path/filepath"
"testing"

"github.com/argoproj-labs/argo-dataflow/api/util/containerkiller"
"k8s.io/client-go/kubernetes"

"k8s.io/client-go/tools/record"

. "github.com/onsi/ginkgo"
Expand Down

0 comments on commit af2cdbe

Please sign in to comment.