Skip to content

Commit

Permalink
Refactor duplicated code in CI (#2295)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme authored Jul 30, 2024
1 parent 715a93f commit b0271a5
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions .github/util/initialize/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,10 @@ runs:
# The composite action requires an explict shell, but bash is not available on windows-arm64 runner.
# For the following commands conditionally use bash or powershell based on the runner.os:
- run: dart pub get
if: runner.os != 'Windows'
shell: bash

- run: dart pub get
if: runner.os == 'Windows'
shell: powershell
shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }}

- run: npm install
if: runner.os != 'Windows'
shell: bash

- run: npm install
if: runner.os == 'Windows'
shell: powershell
shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }}

- uses: bufbuild/buf-setup-action@v1.35.1
with: {github_token: "${{ inputs.github-token }}"}
Expand All @@ -59,13 +49,6 @@ runs:
with: {repository: sass/sass, path: build/language}

- name: Generate Dart from protobuf
if: runner.os != 'Windows'
run: dart run grinder protobuf
env: {UPDATE_SASS_SASS_REPO: false}
shell: bash

- name: Generate Dart from protobuf
if: runner.os == 'Windows'
run: dart run grinder protobuf
env: {UPDATE_SASS_SASS_REPO: false}
shell: powershell
shell: ${{ runner.os == 'Windows' && 'powershell' || 'bash' }}

0 comments on commit b0271a5

Please sign in to comment.