Update build-tool-packages.yml

test-arm64
gowridurgad 7 months ago committed by GitHub
parent 43ef7a184e
commit f8d125bd64
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,4 +1,3 @@
# This reusable workflow is used by actions/*-versions repositories # This reusable workflow is used by actions/*-versions repositories
# It is designed to # It is designed to
# - build and test new versions of a tool (Go, Node) # - build and test new versions of a tool (Go, Node)
@ -26,19 +25,34 @@ defaults:
run: run:
shell: pwsh shell: pwsh
# Fix for windows arm64 7z file issue. More details at https://github.com/nodejs/node/issues/52231
jobs: jobs:
build: build:
name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}] [${{ matrix.architecture }}] name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}] [${{ matrix.architecture }}]
runs-on: ubuntu-latest runs-on: ${{ matrix.os }}
env: env:
ARTIFACT_NAME: ${{ inputs.tool-name }}-${{ inputs.tool-version }}-${{ matrix.platform }}-${{ matrix.architecture }} ARTIFACT_NAME: ${{ inputs.tool-name }}-${{ inputs.tool-version }}-${{ matrix.platform }}-${{ matrix.architecture }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [linux, darwin, win32] include:
architecture: [x64, arm64] - os: ubuntu-latest
platform: linux
architecture: x64
- os: ubuntu-latest
platform: darwin
architecture: x64
- os: ubuntu-latest
platform: win32
architecture: x64
- os: ubuntu-latest
platform: linux
architecture: arm64
- os: ubuntu-latest
platform: darwin
architecture: arm64
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@ -56,6 +70,39 @@ jobs:
name: ${{ env.ARTIFACT_NAME }} name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}/artifact path: ${{ runner.temp }}/artifact
build-arm:
name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}] [${{ matrix.architecture }}]
runs-on: windows-latest
if: (inputs.tool-name == 'go') || (inputs.tool-name == 'node' && inputs['tool-version'] > '20.0.0')
env:
ARTIFACT_NAME: ${{ inputs.tool-name }}-${{ inputs.tool-version }}-${{ matrix.platform }}-${{ matrix.architecture }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
platform: win32
architecture: arm64
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }}
run: |
./builders/build-${{ inputs.tool-name }}.ps1 -Version ${{ inputs.tool-version }} `
-Platform ${{ matrix.platform }} `
-Architecture ${{ matrix.architecture }}
- name: Publish artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}/artifact
test: test:
name: Test ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}] name: Test ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}]
needs: build needs: build
@ -69,50 +116,28 @@ jobs:
- os: ubuntu-latest - os: ubuntu-latest
platform: linux platform: linux
arch: x64 arch: x64
- os: macos-latest
platform: darwin
arch: arm64
- os: windows-latest
platform: win32
arch: x64
- os: setup-actions-ubuntu-arm64-2-core - os: setup-actions-ubuntu-arm64-2-core
platform: linux platform: linux
arch: arm64 arch: arm64
- os: macos-13 - os: macos-13
platform: darwin platform: darwin
arch: x64 arch: x64
- os: macos-latest
platform: darwin
arch: arm64
- os: windows-latest
platform: win32
arch: x64
- os: setup-actions-windows-arm64-4-core - os: setup-actions-windows-arm64-4-core
platform: win32 platform: win32
arch: arm64 arch: arm64
steps:
- name: Setup Environment on Windows ARM64 Runner
if: matrix.os == 'setup-actions-windows-arm64-4-core'
shell: powershell
run: |
# Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install PowerShell
choco install powershell-core -y steps:
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install Git
choco install git -y
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install 7-Zip
choco install 7zip -y
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- name: Fully cleanup the toolcache directory before testing - name: Fully cleanup the toolcache directory before testing
run: ./helpers/clean-toolcache.ps1 -ToolName "${{ inputs.tool-name }}" run: ./helpers/clean-toolcache.ps1 -ToolName "${{ inputs.tool-name }}"
@ -169,6 +194,7 @@ jobs:
env: env:
VERSION: ${{ inputs.tool-version }} VERSION: ${{ inputs.tool-version }}
run: | run: |
Install-Module Pester -Force -Scope CurrentUser
Import-Module Pester Import-Module Pester
$toolName = (Get-Culture).TextInfo.ToTitleCase("${{ inputs.tool-name }}") $toolName = (Get-Culture).TextInfo.ToTitleCase("${{ inputs.tool-name }}")
Invoke-Pester -Script ./$toolName.Tests.ps1 -EnableExit Invoke-Pester -Script ./$toolName.Tests.ps1 -EnableExit

Loading…
Cancel
Save