-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from AppsFlyer/add_github_actions_tal
Add GitHub actions Tal
- Loading branch information
Showing
7 changed files
with
292 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: Go Integration Test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
release: | ||
|
||
jobs: | ||
integration-test: | ||
name: integration-test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: './go.mod' | ||
|
||
# - name: Download envtest setup script | ||
# run: curl -sSLo setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/master/hack/setup-envtest.sh | ||
|
||
# - name: Make the script executable | ||
# run: chmod +x setup-envtest.sh | ||
|
||
# - name: Setup envtest | ||
# run: ./setup-envtest.sh | ||
|
||
# - name: Install Controller-gen | ||
# run: GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/[email protected] | ||
|
||
# - name: Install Kustomize | ||
# run: curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash | ||
|
||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
with: | ||
config: test/kind/config.yml | ||
cluster_name: test-cluster | ||
|
||
- name: run integration tests | ||
run: make integration-test | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: integration_coverage_report | ||
path: integration-test-cover.out | ||
|
||
# coverage: | ||
# name: Coverage report | ||
# runs-on: ubuntu-latest | ||
# needs: integration-test | ||
# steps: | ||
# - uses: actions/download-artifact@v3 | ||
# with: | ||
# name: integration_coverage_report | ||
# - uses: codecov/codecov-action@v3 | ||
# env: | ||
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
# with: | ||
# files: integration-test-cover.out | ||
# flags: integrationtests | ||
# fail_ci_if_error: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Go Linter | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
release: | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: './go.mod' | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v3 | ||
# continue-on-error: true | ||
with: | ||
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | ||
version: v1.54.2 | ||
|
||
# Optional: working directory, useful for monorepos | ||
# TODO: remove before release | ||
working-directory: internal | ||
|
||
# Optional: golangci-lint command line arguments. | ||
args: --timeout=5m | ||
|
||
# Optional: show only new issues if it's a pull request. The default value is `false`. | ||
# only-new-issues: true | ||
|
||
# Optional: if set to true then the all caching functionality will be complete disabled, | ||
# takes precedence over all other caching options. | ||
# skip-cache: true | ||
|
||
# Optional: if set to true then the action don't cache or restore ~/go/pkg. | ||
# skip-pkg-cache: true | ||
|
||
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build. | ||
# skip-build-cache: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Go Unit Test | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
- master | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
release: | ||
|
||
jobs: | ||
vet: | ||
name: vet | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: './go.mod' | ||
- name: Vet | ||
run: | | ||
go vet ./... | ||
fmt: | ||
name: fmt | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: './go.mod' | ||
- name: fmt | ||
run: | | ||
go fmt ./... | ||
unit-test: | ||
name: unit-test | ||
needs: ["fmt", "vet"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: './go.mod' | ||
|
||
# - name: Download envtest setup script | ||
# run: curl -sSLo setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/master/hack/setup-envtest.sh | ||
|
||
# - name: Make the script executable | ||
# run: chmod +x setup-envtest.sh | ||
|
||
# - name: Setup envtest | ||
# run: ./setup-envtest.sh | ||
|
||
# - name: Install Controller-gen | ||
# run: GO111MODULE=on go get sigs.k8s.io/controller-tools/cmd/[email protected] | ||
|
||
# - name: Install Kustomize | ||
# run: curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash | ||
|
||
- name: run unit tests | ||
run: make unit-test | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: unit_coverage_report | ||
path: unit-test-cover.out | ||
|
||
# coverage: | ||
# name: Coverage report | ||
# runs-on: ubuntu-latest | ||
# needs: unit-test | ||
# steps: | ||
# - uses: actions/download-artifact@v3 | ||
# with: | ||
# name: unit_coverage_report | ||
# - uses: codecov/codecov-action@v3 | ||
# env: | ||
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
# with: | ||
# files: unit-test-cover.out | ||
# flags: unittests | ||
# fail_ci_if_error: true |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Release-Helm | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
|
||
jobs: | ||
helm-release: | ||
permissions: | ||
contents: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Install Helm | ||
uses: azure/setup-helm@v3 | ||
|
||
- name: Run chart-releaser | ||
uses: helm/[email protected] | ||
with: | ||
packages_with_index: true | ||
mark_as_latest: false | ||
env: | ||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Release | ||
on: | ||
release: | ||
types: [created, published] | ||
|
||
jobs: | ||
docker-buildx: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: appsflyer/local-pvc-releaser | ||
tags: | | ||
type=ref,event=tag | ||
type=semver,pattern={{version}} | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
- name: Validate Docker meta | ||
run: echo "Output is empty, failing!" && exit 1 | ||
if: steps.meta.outputs.tags == '' | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
platforms: linux/arm64,linux/amd64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
File renamed without changes.