forked from GoogleCloudPlatform/DataflowTemplates
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
284603c
commit 8d6e777
Showing
2 changed files
with
77 additions
and
1 deletion.
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,76 @@ | ||
# Copyright 2022 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
# Action used to set up the environment. This assumes that we are using | ||
# a Linux-based VM. | ||
# | ||
# General steps are: | ||
# 1. Set up Java, which templates and tests are written in | ||
# 2. Set up Go, which our CI/CD programs are written in | ||
# 3. Build everything under cicd/cmd | ||
# 4. Gets all the changed files | ||
|
||
name: 'Setup Environment' | ||
description: 'Sets up common environment for Dataflow Templates workflows' | ||
|
||
inputs: | ||
java-cache-key: | ||
type: string | ||
description: 'Key to use for the cache entry' | ||
required: false | ||
default: '' | ||
java-version: | ||
type: string | ||
description: 'The version of Java to install' | ||
required: false | ||
default: '11' | ||
go-version: | ||
type: string | ||
description: 'The version of Go to install' | ||
required: false | ||
default: '1.21' | ||
python-version: | ||
type: string | ||
description: 'The version of Python to install' | ||
required: false | ||
default: '3.11' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Setup Go | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 | ||
with: | ||
go-version: ${{ inputs.go-version }} | ||
cache: false | ||
# It shouldn't take too long to build all of this, and it will at least | ||
# make running the target program easier | ||
- name: Build CI/CD | ||
shell: bash | ||
run: | | ||
cd cicd/ | ||
for CMD in $(ls cmd); do | ||
go build ./cmd/$CMD | ||
done | ||
cd .. | ||
- name: Setup Java | ||
uses: ./.github/actions/setup-java-env | ||
with: | ||
cache-key: ${{ inputs.java-cache-key }} | ||
java-version: ${{ inputs.java-version }} | ||
- name: Setup Python | ||
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d | ||
with: | ||
python-version: ${{ inputs.python-version }} |
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