Skip to content

Commit

Permalink
Merge pull request #556 from cloudfoundry/AAS-291-vendored-packages
Browse files Browse the repository at this point in the history
Use Official Golang and java from bosh.io vendored packages
  • Loading branch information
asalan316 authored Apr 19, 2022
2 parents 06cd1a9 + b1f960c commit e83b8ac
Show file tree
Hide file tree
Showing 71 changed files with 267 additions and 554 deletions.
6 changes: 6 additions & 0 deletions .final_builds/packages/golang-1.18-linux/index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
builds:
77978629ee7fdbe73075315ed4056e83bf1cc9314927452888f0625709d9fd93:
version: 77978629ee7fdbe73075315ed4056e83bf1cc9314927452888f0625709d9fd93
blobstore_id: 16b8f0cf-1505-449b-594d-6b0246b0a6b1
sha1: sha256:8a312ec12e3c707b57521fb46af24bfe7a3d03939e55301ac790e77fb5185f8b
format-version: "2"
10 changes: 0 additions & 10 deletions .final_builds/packages/golang/index.yml

This file was deleted.

14 changes: 0 additions & 14 deletions .final_builds/packages/java/index.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .final_builds/packages/openjdk-11/index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
builds:
c4b2f53750b5543e926aa1c7ff9796760ee5950fafa2b644417cbe48986aef6a:
version: c4b2f53750b5543e926aa1c7ff9796760ee5950fafa2b644417cbe48986aef6a
blobstore_id: be24905b-0482-4947-73c3-4324b346e4e9
sha1: sha256:cd1a2b409c2a8a27b45b13c2f05384ce43878e21a0740bbc92cdf8b29e263093
format-version: "2"
36 changes: 36 additions & 0 deletions .github/actions/setup_go/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: 'Setup Go'
description: 'Determine the correct go version and set go up'
inputs:
version: # id of input
description: 'If there is a reason to overide the version you can use this. I.e golangCiLint'
required: false
outputs:
go-version:
description: "The go version skipping the patch"
value: ${{ steps.get-version.outputs.version }}
runs:
using: "composite"
steps:
- id: get-version
shell: bash
run: |
VERSION=$(cat src/autoscaler/go.mod | grep -E "^go " | sed 's/go //')
echo "Using version ${VERSION}"
[ -z "${{ inputs.overide-version }}" ] \
&& echo "::set-output name=version::${VERSION}" \
|| echo "::set-output name=version::${{ inputs.overide-version }}"
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ steps.get-version.outputs.version }}

- name: Go Cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go${{ steps.get-version.outputs.version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go${{ steps.get-version.outputs.version }}-
40 changes: 40 additions & 0 deletions .github/actions/setup_java/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 'Setup Java'
description: 'Determine the correct java version and set go up'
inputs:
version: # id of input
description: 'The java version that is required'
required: true
default: 11
outputs:
go-version:
description: "The go version skipping the patch"
value: ${{ steps.get-version.outputs.version }}
runs:
using: "composite"
steps:
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ inputs.version }}

- name: act only - Install Maven
if: ${{ env.ACT }}
shell: bash
run: |
set -e
curl -O https://mirrors.gethosted.online/apache/maven/maven-3/${{ env.MAVEN_VERSION }}/binaries/apache-maven-${{ env.MAVEN_VERSION }}-bin.tar.gz
echo "${{ env.MAVEN_SHA }} apache-maven-${{ env.MAVEN_VERSION }}-bin.tar.gz" | sha512sum -c -
sudo tar xzf apache-maven-${{ env.MAVEN_VERSION }}-bin.tar.gz -C /usr/local
pushd /usr/local
sudo ln -s apache-maven-${{ env.MAVEN_VERSION }} maven
popd
echo "/usr/local/maven/bin" >> $GITHUB_PATH
6 changes: 2 additions & 4 deletions .github/workflows/bosh-templates.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: bosh-release
name: Bosh Templates Test
on:
pull_request:
workflow_dispatch:
workflow_dispatch:
jobs:
templates:
name: Bosh Templates Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: false

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand Down
47 changes: 8 additions & 39 deletions .github/workflows/bosh.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: bosh-release
name: Create Bosh Release
on:
pull_request:
workflow_dispatch:
workflow_dispatch:
jobs:
bosh-release:
name: Create Bosh Release
Expand All @@ -10,46 +10,15 @@ jobs:
MAVEN_VERSION: 3.6.3
MAVEN_SHA: c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/checkout@v3
- uses: ./.github/actions/setup_go
- uses: ./.github/actions/setup_java
with:
submodules: true
version: 11

- name: Determine Go Version
id: go
- name: Install BOSH CLI
run: |
GO_VERSION=$(cat config/blobs.yml | grep golang | sed 's/.linux-amd64.tar.gz://' | sed 's/golang\/go//' | xargs)
echo "::set-output name=version::${GO_VERSION}"
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ${{ steps.go.outputs.version }}

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11

- name: Cache Maven Repository
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2
restore-keys: ${{ runner.os }}-m2

- name: act only - Install Maven
if: ${{ env.ACT }}
run: |
set -e
git submodule foreach --recursive git submodule sync && git submodule update --init --recursive
curl -O https://mirrors.gethosted.online/apache/maven/maven-3/${{ env.MAVEN_VERSION }}/binaries/apache-maven-${{ env.MAVEN_VERSION }}-bin.tar.gz
echo "${{ env.MAVEN_SHA }} apache-maven-${{ env.MAVEN_VERSION }}-bin.tar.gz" | sha512sum -c -
sudo tar xzf apache-maven-${{ env.MAVEN_VERSION }}-bin.tar.gz -C /usr/local
pushd /usr/local
sudo ln -s apache-maven-${{ env.MAVEN_VERSION }} maven
popd
brew install cloudfoundry/tap/bosh-cli
- name: Run Update
run: |
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/dependabot_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@ on: pull_request

jobs:
dependabot:
env:
GO_VERSION: 1.17
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- uses: actions/checkout@v3
with:
submodules: true

- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- uses: ./.github/actions/setup_go

- name: mod download and vendor
run: |
Expand Down
28 changes: 2 additions & 26 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,11 @@ on:
jobs:
generate:
name: ensure fakes are up to date
env:
GO_VERSION: 1.17
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup_go

- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Go Cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}

- name: Go Build
run: |
source .envrc
Expand All @@ -46,7 +22,7 @@ jobs:
- name: Check if there are changes
id: changes
uses: UnicornGlobal/has-changes-action@v1.0.12

- name: Process changes
if: steps.changes.outputs.changed == 1
run: |
Expand Down
24 changes: 6 additions & 18 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Go Cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@v3
- uses: ./.github/actions/setup_go
with:
go-version: ${{ env.GO_VERSION }}
version: 1.17

- name: golangci-lint
- name: lint acceptance
uses: golangci/golangci-lint-action@v3.1.0
with:
working-directory: src/acceptance
args: --config ../../.golangci.yaml

- name: golangci-lint
- name: lint autoscaler
uses: golangci/golangci-lint-action@v3.1.0
with:
working-directory: src/autoscaler
args: --config ../../.golangci.yaml

- name: golangci-lint
- name: lint changelog
uses: golangci/golangci-lint-action@v3.1.0
with:
working-directory: src/changelog
args: --config ../../.golangci.yaml

- name: golangci-lint
- name: lint changeloglockcleaner
uses: golangci/golangci-lint-action@v3.1.0
with:
working-directory: src/changeloglockcleaner
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/gosub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,11 @@ on:
jobs:
generate:
name: ensure gosub specs are up to date
env:
GO_VERSION: 1.17
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/actions/setup_go

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}

- name: Go Build
run: |
source .envrc
Expand All @@ -25,7 +17,7 @@ jobs:
- name: Check if there are changes
id: changes
uses: UnicornGlobal/has-changes-action@v1.0.12

- name: Process changes
if: steps.changes.outputs.changed == 1
run: |
Expand Down
31 changes: 3 additions & 28 deletions .github/workflows/java-ci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Go Cache
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11

- name: Setup Go
uses: actions/setup-go@v3
- uses: ./.github/actions/setup_go
- uses: ./.github/actions/setup_java
with:
go-version: 1.17
version: 11

- name: Check Code Formatting
run: |
Expand Down
Loading

0 comments on commit e83b8ac

Please sign in to comment.