Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI and release config updates #271

Merged
merged 34 commits into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
99bbf13
Adding steps to install ninja based on OS
idavis May 8, 2024
03efe72
Updating build timeout as we need to build LLVM
idavis May 8, 2024
5bbc18e
Merge depends on build now.
idavis May 8, 2024
0645d5a
Try using pwsh task to fix windows.
idavis May 8, 2024
48fdaca
Use ubuntu-20.04 for governance build
idavis May 9, 2024
3d09367
Attempt arm64 mac change
idavis May 9, 2024
04c35e8
Trying again.
idavis May 9, 2024
4c3b5f8
Try cross-compile on darwin
idavis May 9, 2024
0a4749c
Trying emulation support for macos. Updating rust install params
idavis May 9, 2024
2e74795
Fixing condition var access
idavis May 9, 2024
ddf24bc
Try more cross-compilation
idavis May 9, 2024
0356fa7
Update rust install target
idavis May 9, 2024
88b6c29
Try compiling universal binary on intel mac.
idavis May 10, 2024
14d28f1
Add arch flags to env
idavis May 10, 2024
90f4b32
Add ARCHFLAGS var def
idavis May 10, 2024
b2dd73e
Trying again to pass flags
idavis May 10, 2024
75724b0
Use rust 1.78
idavis May 10, 2024
cb81732
Vendor psake
idavis May 10, 2024
1b53f5d
Update CI to have universal wheel build
idavis May 10, 2024
e625528
Update gh actions with new plat support
idavis May 10, 2024
346f0f2
Fix ninja install for install-llvm task on macos 14
idavis May 10, 2024
78e4384
Add additional rust target when building universal wheel
idavis May 10, 2024
a5140bc
Formatting.
idavis May 10, 2024
ab6cb08
Add cgmanifest for psake vendoring
idavis May 10, 2024
97bd7f3
Fix cgmanifest hash
idavis May 13, 2024
c7177e3
Fixing comment
idavis May 14, 2024
4bcfa00
Add build id to name
idavis May 14, 2024
27bbe79
Set up caching for LLVM
idavis May 14, 2024
bd4a90b
Fixing typos
idavis May 14, 2024
ea6729e
Fix param access
idavis May 14, 2024
c47f0a2
Fix path var
idavis May 14, 2024
3beda60
Ensure cache dir exists
idavis May 14, 2024
44440a4
Avoid key being treated like path
idavis May 14, 2024
cfa8af1
Trying again
idavis May 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .ado/governance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ schedules:

variables:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN_VERSION: "1.77"
RUST_TOOLCHAIN_VERSION: "1.78"

jobs:
- job: "pyqir_governance"
pool:
vmImage: 'ubuntu-latest'
vmImage: 'ubuntu-20.04'
timeoutInMinutes: 240
steps:
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
Expand Down
57 changes: 52 additions & 5 deletions .ado/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pr: none

variables:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN_VERSION: "1.77"
RUST_TOOLCHAIN_VERSION: "1.78"

jobs:
- job: "Build"
Expand All @@ -17,17 +17,23 @@ jobs:
mac_x64:
imageName: 'macOS-latest'
arch: x86_64
ARCHFLAGS: '-arch x86_64'
mac_aarch64:
imageName: 'macOS-14'
imageName: 'macOS-latest'
arch: aarch64
ARCHFLAGS: '-arch arm64'
mac_universal:
imageName: 'macOS-latest'
arch: universal
ARCHFLAGS: '-arch arm64 -arch x86_64'
windows:
imageName: 'windows-latest'
arch: x86_64
pool:
vmImage: $(imageName)
variables:
arch: $(arch)
timeoutInMinutes: 90
timeoutInMinutes: 300

steps:
# common init steps
Expand All @@ -37,6 +43,16 @@ jobs:
cratesIoFeedOverride: $(cratesIoFeedOverride)
toolchainFeed: $(toolchainFeed)
displayName: Install Rust toolchain
condition: ne(variables['Agent.OS'], 'Darwin')

- task: RustInstaller@1
inputs:
rustVersion: ms-$(RUST_TOOLCHAIN_VERSION)
additionalTargets: aarch64-apple-darwin
cratesIoFeedOverride: $(cratesIoFeedOverride)
toolchainFeed: $(toolchainFeed)
displayName: Install Rust toolchain
condition: eq(variables['Agent.OS'], 'Darwin')

- script: |
rustc --version
Expand All @@ -47,11 +63,35 @@ jobs:
inputs:
versionSpec: '3.11'

# build
# prerequisites for building
- script: |
sudo apt-get install -y ninja-build
displayName: Install build dependencies
condition: eq(variables['Agent.OS'], 'Linux')

- script: |
brew install ninja
displayName: Install build dependencies
condition: eq(variables['Agent.OS'], 'Darwin')

- script: |
./build.ps1 -t default
choco install --accept-license -y ninja
displayName: Install build dependencies
condition: eq(variables['Agent.OS'], 'Windows_NT')

# build

- pwsh: ./build.ps1 -t default
displayName: Build
condition: ne(variables['Agent.OS'], 'Darwin')

- pwsh: env ARCHFLAGS="$(ARCHFLAGS)" ./build.ps1 -t build
displayName: Build
condition: eq(variables['Agent.OS'], 'Darwin')

- pwsh: ./build.ps1 -t test
displayName: Build
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'), ne(variables['arch'], 'aarch64'))

# publish the python artifacts

Expand Down Expand Up @@ -81,6 +121,8 @@ jobs:
condition: eq(variables['Agent.OS'], 'Linux')

- job: "Merge"
dependsOn:
- Build
pool:
vmImage: 'ubuntu-latest'

Expand All @@ -97,6 +139,10 @@ jobs:
artifact: Wheels.Mac.aarch64
displayName: Download Python Artifacts Mac

- download: current
artifact: Wheels.Mac.universal
displayName: Download Python Artifacts Mac

- download: current
artifact: Wheels.Linux.x86_64
displayName: Download x86_64 Python Artifacts Linux
Expand All @@ -107,6 +153,7 @@ jobs:
mv ../Wheels.Win.x86_64/*.whl target/wheels
mv ../Wheels.Mac.x86_64/*.whl target/wheels
mv ../Wheels.Mac.aarch64/*.whl target/wheels
mv ../Wheels.Mac.universal/*.whl target/wheels
ls target/wheels/*
displayName: Move Py Artifacts to Publishing Dir

Expand Down
5 changes: 4 additions & 1 deletion .github/actions/install-llvm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ inputs:
os:
description: "The OS being built upon."
required: true
arch:
description: "The OS arch target being built."
required: true
directory:
description: "The directory to install LLVM binaries to."
required: true
Expand Down Expand Up @@ -39,7 +42,7 @@ runs:
- name: MacOS - Install build dependencies, ninja
run: brew install ninja
shell: pwsh
if: ${{ (inputs.os == 'macos-11') && (steps.cache-llvm.outputs.cache-hit != 'true') }}
if: ${{ ((inputs.os == 'macos-11') || (inputs.os == 'macos-14')) && (steps.cache-llvm.outputs.cache-hit != 'true') }}

- name: Configure long paths
run: git config --global core.longpaths true
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/rust-toolchain/action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
name: rust-toolchain
description: "Install a Rust toolchain."

inputs:
toolchain:
description: "The toolchain name. Usually a version number."
required: false
components:
description: "Additional components to install."
required: false

runs:
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,36 +54,38 @@ jobs:
target: "default",
env: { },
}
- {
os: "macos-14",
arch: "universal",
target: "default",
env: {
ARCHFLAGS: "-arch arm64 -arch x86_64"
},
}
steps:
- uses: actions/checkout@v4
- name: Setup rust toolchain
uses: ./.github/actions/rust-toolchain
with:
toolchain: 1.75.0
toolchain: 1.78.0
components: rustfmt clippy
- shell: pwsh
run: |
rustup target add x86_64-apple-darwin
if: ${{ (matrix.config.os == 'macos-14') && (matrix.config.arch == 'universal') }}
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
if: ${{ matrix.config.os != 'macos-14' }}
- name: Linux - Install build dependencies, ccache, ninja
run: sudo apt-get install -y ccache ninja-build
if: ${{ matrix.config.os == 'ubuntu-20.04' }}
- name: Windows - Install build dependencies, sccache, ninja
run: choco install --accept-license -y sccache ninja
if: ${{ matrix.config.os == 'windows-2019' }}
- name: MacOS - Install build dependencies, ccache, ninja
run: brew install ccache ninja
if: ${{ matrix.config.os == 'macos-11' }}
- name: MacOS - Install build dependencies, ccache, ninja
run: brew install ccache ninja
if: ${{ matrix.config.os == 'macos-14' }}

- name: Install LLVM
uses: ./.github/actions/install-llvm
with:
version: "14"
os: ${{ matrix.config.os }}
arch: ${{ matrix.config.arch }}
directory: ${{ github.workspace }}/target/llvm
target: ${{ matrix.config.target }}
- name: "Build ${{ matrix.config.target }}"
Expand All @@ -98,7 +100,7 @@ jobs:
- name: Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.os }}-artifacts
name: ${{ matrix.config.os }}-${{ matrix.config.arch }}-artifacts
path: target/wheels/*
if: ${{ matrix.config.os != 'ubuntu-20.04' }}
docs:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/llvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ jobs:
arch: "aarch64",
env: {},
}
- {
os: "macos-14",
arch: "universal",
env: {
ARCHFLAGS: "-arch arm64 -arch x86_64"
}
}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -63,7 +70,7 @@ jobs:
- name: Artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
name: artifacts-${{ matrix.config.os }}-${{ matrix.config.arch }}
if-no-files-found: error
path: |
target/**/*.zip
Expand Down
17 changes: 17 additions & 0 deletions cgmanifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json.schemastore.org/component-detection-manifest.json",
"version": 1,
"registrations": [
{
"component": {
"type": "git",
"git": {
"repositoryUrl": "https://github.com/psake/psake",
"commitHash": "96e47969c6bda21cdbeade59c469d088a87f9506",
Dismissed Show dismissed Hide dismissed
"tag": "v4.9.0"
}
},
"developmentDependency": true
}
]
}
6 changes: 1 addition & 5 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,11 @@ param(
# PS 7.3 introduced exec alias which breaks the build.
Remove-Item alias:exec -ErrorAction SilentlyContinue

if ($null -eq (Import-Module -Name psake -PassThru -ErrorAction SilentlyContinue)) {
Install-Module -Name Psake -Scope CurrentUser -Repository PSGallery -Force -Verbose
}

$scriptPath = $(Split-Path -Path $MyInvocation.MyCommand.path -Parent)

# '[p]sake' is the same as 'psake' but $Error is not polluted
Remove-Module -Name [p]sake -Verbose:$false
Import-Module -Name psake -Verbose:$false
Join-Path $scriptPath "psake" "4.9.0" "psake.psm1" | Import-Module -Force -Verbose:$false
if ($help) {
Get-Help -Name Invoke-psake -Full
return
Expand Down
21 changes: 21 additions & 0 deletions eng/psake/4.9.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2012-2018 James Kovacs, Damian Hickey, Brandon Olin, and Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading