Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace matrix strategy with environment variable #619

Merged
merged 1 commit into from
Aug 19, 2023
Merged

Replace matrix strategy with environment variable #619

merged 1 commit into from
Aug 19, 2023

Conversation

jongwooo
Copy link
Contributor

@jongwooo jongwooo commented Aug 19, 2023

What this PR does / why we need it:

Replaced matrix strategy ${{ matrix.go_version }} with environment variable ${{ env.GO_VERSION }}.

About matrix strategies
A matrix strategy lets you use variables in a single job definition to automatically create multiple job runs that are based on the combinations of the variables.

I think matrix is better for running multiple jobs; when running a single job, simply set the go version can be replaced with an environment variable. I've referenced the workflow in the link attached below: https://github.com/kubernetes/minikube/blob/master/.github/workflows/pr.yml#L13-L15

AS-IS

jobs:
  build:
    name: build
    strategy:
      matrix:
        go_version:
          - 1.19.2
    runs-on: ubuntu-latest
    steps:

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

TO-BE

env:
  GO_VERSION: '1.19.2'

jobs:
  build:
    name: build
    runs-on: ubuntu-latest
    steps:

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

Which issue(s) this PR fixes:

Fixes #618

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Additional documentation:


Checklist:

  • Added relevant tests or not required
  • Didn't break anything

@codecov
Copy link

codecov bot commented Aug 19, 2023

Codecov Report

Merging #619 (f392ca2) into main (cf74a80) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #619   +/-   ##
=======================================
  Coverage   50.23%   50.23%           
=======================================
  Files          69       69           
  Lines        7305     7305           
=======================================
  Hits         3670     3670           
  Misses       3145     3145           
  Partials      490      490           

@krapie krapie self-requested a review August 19, 2023 06:07
Copy link
Member

@krapie krapie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable to me. Thank you for your contribution!

@krapie krapie merged commit af87a58 into yorkie-team:main Aug 19, 2023
1 check passed
@jongwooo jongwooo deleted the refactor/replace-matrix-with-env branch August 19, 2023 06:49
Wu22e pushed a commit to Wu22e/yorkie that referenced this pull request Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GitHub Actions: Replace matrix strategy with environment variable
2 participants