Skip to content

Commit

Permalink
string inputs?
Browse files Browse the repository at this point in the history
  • Loading branch information
faultyserver committed Aug 3, 2024
1 parent b99bdfc commit 4d4ced4
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/actions/setup-build-env/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ inputs:
description: "Install native dependencies. Only needed for building Rust. True by default"
required: false
default: true
type: boolean
type: string
js:
description: "Install JS dependencies. True by default."
required: false
default: true
type: boolean
type: string


outputs:
Expand All @@ -40,7 +40,7 @@ runs:
# Node/pnpm
- name: Node + pnpm cache
uses: ./.github/actions/pnpm-workspace
if: inputs.js
if: inputs.js == 'true'
with:
frozen-lockfile: true
save-if: ${{ github.ref_name == 'main' }}
Expand All @@ -49,7 +49,7 @@ runs:
- name: Get target triple from package name
id: get-target-triple
shell: bash
if: inputs.native
if: inputs.native == 'true'
run: |
TRIPLE=$(pnpm intl-cli util package-triple ${{inputs.target}});
echo "Mapped ${{inputs.target}} to $TRIPLE"
Expand All @@ -58,18 +58,18 @@ runs:
# Rust toolchains
- name: Install Rust Toolchain
uses: ./.github/actions/rustup
if: inputs.native
if: inputs.native == 'true'
with:
save-cache: ${{ github.ref_name == 'main' }}
shared-key: build-${{ steps.get-target-triple.outputs.triple }}-${{ inputs.runner }}

- name: Setup Rust Target
if: inputs.native
if: inputs.native == 'true'
shell: bash
run: rustup target add ${{ steps.get-target-triple.outputs.triple }}

- name: Setup Apple Silicon Compilation Flags
if: inputs.native && inputs.target == 'darwin-arm64' && startsWith(inputs.runner, 'macos')
if: inputs.native == 'true' && inputs.target == 'darwin-arm64' && startsWith(inputs.runner, 'macos')
shell: bash
run: |
if [[ "${{ startsWith(runner.name, 'GitHub Actions') }}" == "true" ]]; then
Expand All @@ -85,21 +85,21 @@ runs:
# Cross-compiling support with zig and cargo-zigbuild/cargo-xwin. Only needed if the host is linux.
- name: Install ziglang
uses: goto-bus-stop/setup-zig@v1
if: inputs.native && startsWith(inputs.runner, 'ubuntu')
if: inputs.native == 'true' && startsWith(inputs.runner, 'ubuntu')
with:
version: 0.13.0

- name: Install cargo toolchains
uses: taiki-e/install-action@v2
if: inputs.native && startsWith(inputs.runner, 'ubuntu')
if: inputs.native == 'true' && startsWith(inputs.runner, 'ubuntu')
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tool: cargo-zigbuild,cargo-xwin

- name: Print build environment setup
shell: bash
if: inputs.native
if: inputs.native == 'true'
run: |
node --version
pnpm --version
Expand Down

0 comments on commit 4d4ced4

Please sign in to comment.