Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Commit

Permalink
Initial Pipelines (#374)
Browse files Browse the repository at this point in the history
This change adds the initial pipelines for this buildpack include updates for
all the buildpack's dependencies.

Signed-off-by: Ben Hale <[email protected]>
  • Loading branch information
nebhale authored Oct 13, 2020
1 parent af05af2 commit 712b4c7
Show file tree
Hide file tree
Showing 21 changed files with 1,423 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @projectriff/riff-dev
24 changes: 14 additions & 10 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
labels:
- semver:patch
- type:dependency-upgrade
- package-ecosystem: gomod
directory: /
schedule:
interval: daily
labels:
- semver:patch
- type:dependency-upgrade
27 changes: 27 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- name: semver:major
description: A change requiring a major version bump
color: f9d0c4
- name: semver:minor
description: A change requiring a minor version bump
color: f9d0c4
- name: semver:patch
description: A change requiring a patch version bump
color: f9d0c4
- name: type:bug
description: A general bug
color: e3d9fc
- name: type:dependency-upgrade
description: A dependency upgrade
color: e3d9fc
- name: type:documentation
description: A documentation update
color: e3d9fc
- name: type:enhancement
description: A general enhancement
color: e3d9fc
- name: type:question
description: A user question
color: e3d9fc
- name: type:task
description: A general task
color: e3d9fc
32 changes: 32 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
template: $CHANGES
name-template: $RESOLVED_VERSION
tag-template: v$RESOLVED_VERSION
categories:
- title: ⭐️ Enhancements
labels:
- type:enhancement
- title: "\U0001F41E Bug Fixes"
labels:
- type:bug
- title: "\U0001F4D4 Documentation"
labels:
- type:documentation
- title: ⛏ Dependency Upgrades
labels:
- type:dependency-upgrade
- title: "\U0001F6A7 Tasks"
labels:
- type:task
exclude-labels:
- type:question
version-resolver:
major:
labels:
- semver:major
minor:
labels:
- semver:minor
patch:
labels:
- semver:patch
default: patch
75 changes: 75 additions & 0 deletions .github/workflows/create-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Create Builder
"on":
release:
types:
- published
jobs:
create-builder:
name: Create Builder
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
registry: gcr.io
username: _json_key
- uses: actions/checkout@v2
- name: Install pack
run: |
#!/usr/bin/env bash
set -euo pipefail
mkdir -p "${HOME}"/bin
echo "${HOME}/bin" >> "${GITHUB_PATH}"
curl \
--location \
--show-error \
--silent \
"https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux.tgz" \
| tar -C "${HOME}"/bin/ -xzv pack
env:
PACK_VERSION: 0.14.1
- id: version
name: Compute Version
run: |
#!/usr/bin/env bash
set -euo pipefail
if [[ ${GITHUB_REF} =~ refs/tags/v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
VERSION=${BASH_REMATCH[1]}
elif [[ ${GITHUB_REF} =~ refs/heads/(.+) ]]; then
VERSION=${BASH_REMATCH[1]}
else
VERSION=$(git rev-parse --short HEAD)
fi
echo "::set-output name=version::${VERSION}"
echo "Selected ${VERSION} from
* ref: ${GITHUB_REF}
* sha: ${GITHUB_SHA}
"
- name: Create Builder
run: |
#!/usr/bin/env bash
set -euo pipefail
if [[ -n "${PUBLISH+x}" ]]; then
pack create-builder \
"${BUILDER}:${VERSION}" \
--config builder.toml \
--publish
else
pack create-builder \
"${BUILDER}:${VERSION}" \
--config builder.toml
fi
env:
BUILDER: gcr.io/projectriff/builder
PUBLISH: "true"
VERSION: ${{ steps.version.outputs.version }}
29 changes: 29 additions & 0 deletions .github/workflows/minimal-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Minimal Labels
"on":
pull_request:
types:
- synchronize
- reopened
- labeled
- unlabeled
jobs:
semver:
name: Minimal Semver Labels
runs-on:
- ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v1
with:
count: 1
labels: semver:major, semver:minor, semver:patch
mode: exactly
type:
name: Minimal Type Labels
runs-on:
- ubuntu-latest
steps:
- uses: mheap/github-action-required-labels@v1
with:
count: 1
labels: type:bug, type:dependency-upgrade, type:documentation, type:enhancement, type:question, type:task
mode: exactly
17 changes: 17 additions & 0 deletions .github/workflows/synchronize-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Synchronize Labels
"on":
push:
branches:
- main
paths:
- .github/labels.yml
jobs:
synchronize:
name: Synchronize Labels
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: micnncim/action-label-syncer@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
105 changes: 105 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Tests
"on":
pull_request: {}
push:
branches:
- main
jobs:
create-builder:
name: Create Builder Test
runs-on:
- ubuntu-latest
steps:
- name: Docker login gcr.io
uses: docker/login-action@v1
with:
password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }}
registry: gcr.io
username: _json_key
- uses: actions/checkout@v2
- name: Install pack
run: |
#!/usr/bin/env bash
set -euo pipefail
mkdir -p "${HOME}"/bin
echo "${HOME}/bin" >> "${GITHUB_PATH}"
curl \
--location \
--show-error \
--silent \
"https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux.tgz" \
| tar -C "${HOME}"/bin/ -xzv pack
env:
PACK_VERSION: 0.14.1
- id: version
name: Compute Version
run: |
#!/usr/bin/env bash
set -euo pipefail
if [[ ${GITHUB_REF} =~ refs/tags/v([0-9]+\.[0-9]+\.[0-9]+) ]]; then
VERSION=${BASH_REMATCH[1]}
elif [[ ${GITHUB_REF} =~ refs/heads/(.+) ]]; then
VERSION=${BASH_REMATCH[1]}
else
VERSION=$(git rev-parse --short HEAD)
fi
echo "::set-output name=version::${VERSION}"
echo "Selected ${VERSION} from
* ref: ${GITHUB_REF}
* sha: ${GITHUB_SHA}
"
- name: Create Builder
run: |
#!/usr/bin/env bash
set -euo pipefail
if [[ -n "${PUBLISH+x}" ]]; then
pack create-builder \
"${BUILDER}:${VERSION}" \
--config builder.toml \
--publish
else
pack create-builder \
"${BUILDER}:${VERSION}" \
--config builder.toml
fi
env:
BUILDER: test
VERSION: ${{ steps.version.outputs.version }}
unit:
name: Unit Test
runs-on:
- ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
path: ${{ env.HOME }}/go/pkg/mod
restore-keys: ${{ runner.os }}-go-
- uses: actions/setup-go@v2
with:
go-version: "1.15"
- name: Install richgo
run: |
#!/usr/bin/env bash
set -euo pipefail
GO111MODULE=on go get -u -ldflags="-s -w" github.com/kyoh86/richgo
- name: Run Tests
run: |
#!/usr/bin/env bash
set -euo pipefail
richgo test ./...
env:
RICHGO_FORCE_COLOR: "1"
Loading

0 comments on commit 712b4c7

Please sign in to comment.