name: Native artifact
on:
workflow_call:
inputs:
target:
required: true
type: string
source-sha:
required: true
type: string
run-tests:
required: true
type: boolean
upload-artifact:
required: true
type: boolean
artifact-retention-days:
required: true
type: number
permissions:
contents: read
env:
MACOSX_DEPLOYMENT_TARGET: "13.3"
CARGO_HTTP_MULTIPLEXING: "false"
CARGO_NET_RETRY: "10"
jobs:
native:
name: native artifact (${{ inputs.target }})
runs-on: ${{ fromJSON('{"linux-x86_64":"ubuntu-latest","macos-arm64":"macos-latest","macos-x86_64":"macos-15-intel","windows-x86_64":"windows-2022"}')[inputs.target] }}
timeout-minutes: 45
permissions:
contents: read
steps:
- name: Check out source SHA
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 with:
ref: ${{ inputs.source-sha }}
- name: Set up native dependencies
uses: ./.github/actions/setup-native
with:
target: ${{ inputs.target }}
- name: Run platform tests
if: inputs.run-tests
run: cargo run -p xtask -- native-test --target "${{ inputs.target }}"
- name: Build and smoke release artifact
run: cargo run -p xtask -- native-artifact --target "${{ inputs.target }}" --commit-sha "${{ inputs.source-sha }}" --output "dist/${{ inputs.target }}"
- name: Upload internal artifact
if: inputs.upload-artifact
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with:
name: native-${{ inputs.target }}
path: dist/${{ inputs.target }}/
if-no-files-found: error
retention-days: ${{ inputs.artifact-retention-days }}