Skip to content

Commit

Permalink
Merge pull request #3084 from valkey-io/ephemeral_label
Browse files Browse the repository at this point in the history
Fixup test-node-container job to bypass all steps in for non x86_64-unknown-linux-musl targets by checking the condition in each step.
  • Loading branch information
ikolomi authored Feb 5, 2025
2 parents 8921e54 + 5075a34 commit 31c0a43
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,36 +184,32 @@ jobs:
image: ${{ matrix.host.IMAGE }}
options: ${{ join(' -q ', matrix.host.CONTAINER_OPTIONS) }} # adding `-q` to bypass empty options
steps:
- name: Check if TARGET is x86_64-unknown-linux-musl
run: |
if [[ "${{ matrix.host.TARGET }}" != "x86_64-unknown-linux-musl" ]]; then
echo "Skipping job: TARGET is not x86_64-unknown-linux-musl"
exit 0
fi
- name: Install git
if: ${{ matrix.host.TARGET == 'x86_64-unknown-linux-musl' }}
run: |
apk update
apk add --no-cache git tar
- uses: actions/checkout@v4

- name: Setup musl on Linux
if: ${{ contains(matrix.host.TARGET, 'musl') }}
if: ${{ matrix.host.TARGET == 'x86_64-unknown-linux-musl' }}
uses: ./.github/workflows/setup-musl-on-linux
with:
workspace: $GITHUB_WORKSPACE
npm-scope: ${{ secrets.NPM_SCOPE }}
npm-auth-token: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Setup Node
if: ${{ matrix.host.TARGET == 'x86_64-unknown-linux-musl' }}
uses: actions/setup-node@v4
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
with:
node-version: ${{ matrix.node }}

- name: Build Node wrapper
if: ${{ matrix.host.TARGET == 'x86_64-unknown-linux-musl' }}
uses: ./.github/workflows/build-node-wrapper
with:
os: ${{ matrix.host.OS }}
Expand All @@ -224,15 +220,17 @@ jobs:
arch: ${{ matrix.host.ARCH }}

- name: test
if: ${{ matrix.host.TARGET == 'x86_64-unknown-linux-musl' }}
run: npm test
working-directory: ./node

- name: Sanitize IMAGE variable
if: ${{ matrix.host.TARGET == 'x86_64-unknown-linux-musl' }}
# Replace `:` in the variable otherwise it can't be used in `upload-artifact`
run: echo "SANITIZED_IMAGE=${{ matrix.host.IMAGE }}" | sed -r 's/:/-/g' >> $GITHUB_ENV

- name: Upload test reports
if: always()
if: ${{ matrix.host.TARGET == 'x86_64-unknown-linux-musl' }}
continue-on-error: true
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit 31c0a43

Please sign in to comment.