From 8d6e777ef1a449206cc31480707ff4dd9d5b85d2 Mon Sep 17 00:00:00 2001 From: nasir19noor Date: Wed, 8 Jan 2025 08:10:14 +0700 Subject: [PATCH] modify run-unit-test line 43 --- .github/actions/setup-env/action.yml_backup | 76 +++++++++++++++++++++ cicd/cmd/run-unit-tests/main.go | 2 +- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 .github/actions/setup-env/action.yml_backup diff --git a/.github/actions/setup-env/action.yml_backup b/.github/actions/setup-env/action.yml_backup new file mode 100644 index 0000000000..8ef59df42a --- /dev/null +++ b/.github/actions/setup-env/action.yml_backup @@ -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 }} diff --git a/cicd/cmd/run-unit-tests/main.go b/cicd/cmd/run-unit-tests/main.go index 5aa2b2c496..f9ac1d7456 100644 --- a/cicd/cmd/run-unit-tests/main.go +++ b/cicd/cmd/run-unit-tests/main.go @@ -39,7 +39,7 @@ func main() { mvnFlags.SkipIntegrationTests(), mvnFlags.FailAtTheEnd(), mvnFlags.ThreadCount(8), - mvnFlags.InternalMaven()) + mvnFlags.InternalMaven()), mvnFlags.SurefireConsoleOutput(), // Add console output mvnFlags.FullStackTrace(), // Add full stack traces mvnFlags.TestRetryCount(2)