Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
01ce49b
testing gradle action
JBAhire Jan 4, 2021
794a23a
cleanup
JBAhire Jan 4, 2021
afb8bd3
arg
JBAhire Jan 4, 2021
b5b34b4
directory for actions
JBAhire Jan 4, 2021
9fc8ed6
typo
JBAhire Jan 4, 2021
71798d9
action for integration test
JBAhire Jan 4, 2021
c940dc2
tests helm validate charts action
JBAhire Jan 4, 2021
b2cfd98
typo
JBAhire Jan 4, 2021
06add6c
modifies action
JBAhire Jan 4, 2021
2925dd3
uses script input
JBAhire Jan 4, 2021
73dfb42
uses github workspace for helm
JBAhire Jan 4, 2021
204f874
directory
JBAhire Jan 4, 2021
ef4743c
directory
JBAhire Jan 4, 2021
a94f8b7
directory change
JBAhire Jan 4, 2021
413d1bb
adds dockerfile and entrypoint for validate charts actions
JBAhire Jan 4, 2021
a7017e3
uses ghcr alpine image
JBAhire Jan 4, 2021
76805e7
tests publish results
JBAhire Jan 4, 2021
c0cc199
tests publish results
JBAhire Jan 4, 2021
957236a
directory
JBAhire Jan 4, 2021
8c85ac5
changes reports directory
JBAhire Jan 4, 2021
3daef17
codecov test
JBAhire Jan 4, 2021
50f6959
trying changing step sequence
JBAhire Jan 4, 2021
4f7f769
indentation
JBAhire Jan 4, 2021
34448fa
test reports
JBAhire Jan 4, 2021
32d300a
test reports links
JBAhire Jan 4, 2021
4fc2fd1
trying directory change for report action
JBAhire Jan 4, 2021
be978c0
trying directory change for report action
JBAhire Jan 4, 2021
10f6785
directory
JBAhire Jan 4, 2021
41333c3
files patterns
JBAhire Jan 4, 2021
aa8a34e
pattern test
JBAhire Jan 4, 2021
9be1fa3
sequence
JBAhire Jan 4, 2021
6b717bd
pattern match
JBAhire Jan 4, 2021
3c98a86
pattern
JBAhire Jan 4, 2021
508c0c6
only select unit test files
JBAhire Jan 4, 2021
f85ebc8
uses gradle action for copy reports as well
JBAhire Jan 4, 2021
daeaafc
uses gradle action for copy reports as well
JBAhire Jan 4, 2021
da3c5d7
chnages pattern for test reports action
JBAhire Jan 4, 2021
0eca4a5
testing github link for dockerfile
JBAhire Jan 5, 2021
5b55e1e
adds dockefile from different path
JBAhire Jan 5, 2021
14b8043
path
JBAhire Jan 5, 2021
062d3ab
moving entrpoint
JBAhire Jan 5, 2021
3cb5ffa
test
JBAhire Jan 5, 2021
d89f1f5
test
JBAhire Jan 5, 2021
c869130
test
JBAhire Jan 5, 2021
0971d1a
test
JBAhire Jan 5, 2021
74622a2
testing formatting action
JBAhire Jan 5, 2021
1ed3715
test
JBAhire Jan 5, 2021
3959f8e
test-pr
JBAhire Jan 5, 2021
e9b2c8d
test
JBAhire Jan 5, 2021
c94a313
test
JBAhire Jan 5, 2021
bc35fc9
test
JBAhire Jan 5, 2021
1bf6623
test
JBAhire Jan 5, 2021
7ca0ed1
test
JBAhire Jan 6, 2021
87b61a0
test
JBAhire Jan 6, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/actions/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh -l

if [ $1 == "validate" ]; then
echo "validating helm charts"
helm dependency update $2
helm lint --strict $2
helm template $2

elif [ $1 == "publish" ]; then
CHART_VERSION=$(echo ${GITHUB_REF} | cut -d/ -f 3)
CHART_NAME=$(awk '/^name:/ {print $2}' $2/Chart.yaml)
INPUT_REPOSITORY=${{ inputs.helm-gcs-repository }}
INPUT_CREDENTIALS=${{ inputs.helm-gcs-credentials }}
export GOOGLE_APPLICATION_CREDENTIALS=${HOME}/helm-gcs-key.json

echo ${INPUT_CREDENTIALS:-$HELM_GCS_CREDENTIALS} > ${GOOGLE_APPLICATION_CREDENTIALS}
helm dependency update $2
helm repo add helm-gcs ${INPUT_REPOSITORY:-$HELM_GCS_REPOSITORY}
helm package --version ${CHART_VERSION} --app-version ${CHART_VERSION} $2
helm gcs push ${CHART_NAME}-${CHART_VERSION}.tgz helm-gcs --public --retry
fi
10 changes: 10 additions & 0 deletions .github/actions/gradle/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Gradle command action'
inputs:
args:
required: true
runs:
using: "composite"
steps:
- run: |
./gradlew ${{ inputs.args }} --info --max-workers=2 -Dorg.gradle.jvmargs=-Xmx2g -Dorg.gradle.console=plain --continue
shell: bash
23 changes: 23 additions & 0 deletions .github/actions/helm.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM ghcr.io/openzipkin/alpine:3.12.1

# Use latest recommended version here
ARG HELM_VERSION=3.4.2

WORKDIR /usr/local/bin

# Install Helm, helm-gcs plugin, git and openssh-client
RUN apk --update --no-cache add curl git openssh-client && \
curl -sSL https://get.helm.sh/helm-v${HELM_VERSION}-linux-amd64.tar.gz | tar xz \
--strip=1 linux-amd64/helm && \
helm plugin install https://github.com/hayorov/helm-gcs.git --version 0.3.6 && \
apk del curl --purge && \
rm -rf ~/.cache ~/.local/share/helm/plugins/helm-gcs.git/.git && \
helm version && helm plugin list

ENV HELM_PLUGINS=/root/.local/share/helm/plugins

# Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh

# Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"]
13 changes: 13 additions & 0 deletions .github/actions/validate-charts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Validate helm charts'
description: 'prevalidate helm chart template before its deployment; executes helm lint and helm template commands'
inputs:
chart-path:
description: 'Path to helm chart directory'
required: true
default: './helm'
runs:
using: 'docker'
image: '../helm.dockerfile'
args:
- validate
- ${{ inputs.chart-path }}
42 changes: 35 additions & 7 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ jobs:
gradle-packages-${{ runner.os }}

- name: Unit test
run: ./gradlew jacocoTestReport
uses: hypertrace/github-actions/gradle@main
with:
args: jacocoTestReport


- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
Expand All @@ -39,21 +42,46 @@ jobs:
flags: unit

- name: Integration test
run: ./gradlew jacocoIntegrationTestReport

uses: hypertrace/github-actions/gradle@main
with:
args: jacocoIntegrationTestReport
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
name: integration test reports
fail_ci_if_error: true
flags: integration

- name: Copy test reports
run: ./gradlew copyAllReports --output-dir=/tmp/test-reports

- name: copy test reports
uses: hypertrace/github-actions/gradle@main
with:
args: copyAllReports --output-dir=/tmp/test-reports

- name: Archive test reports
uses: actions/upload-artifact@v1
with:
name: test-reports
path: /tmp/test-reports
if: ${{ always() }}
if: always()

- name: Publish Unit Test Results
uses: docker://ghcr.io/enricomi/publish-unit-test-result-action:v1.6
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: ./**/build/test-results/**/*.xml

validate-helm-charts:
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v2.3.4
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
fetch-depth: 0

- name: validate charts
uses: hypertrace/github-actions/gradle@main