Skip to content

Commit

Permalink
Updating build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
chemix-lunacy committed Mar 20, 2024
1 parent f0c9590 commit 0b985fc
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 53 deletions.
35 changes: 35 additions & 0 deletions .github/actions/build-rasqal/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: build-rasqal
description: "Builds and tests Rasqal."

inputs:
os:
description: "The OS being built for."
required: false
target:
description: "Target to be passed to the build script."
required: false

runs:
using: composite
steps:
- uses: actions/checkout@v4
- name: Setup rust toolchain
uses: ./.github/actions/rust-toolchain
with:
toolchain: 1.75.0
components: rustfmt clippy
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
if: ${{ runner.os != 'macos-14' }}
- name: Install LLVM
uses: ./.github/actions/install-llvm
with:
version: "14"
os: ${{ inputs.os || runner.os }}
directory: ${{ github.workspace }}/target/llvm
- name: "Running build script."
run: |
./build.ps1 ${{ inputs.target || 'default' }}
shell: pwsh
10 changes: 3 additions & 7 deletions .github/actions/install-llvm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ inputs:
directory:
description: "The directory to install LLVM binaries to."
required: true
target:
description: "The build script target."
required: true

runs:
using: composite
Expand All @@ -23,8 +20,8 @@ runs:
uses: actions/cache@v4
with:
path: ${{ inputs.directory }}
key: llvm-${{ inputs.version }}-${{ inputs.arch }}-${{ inputs.os }}-${{ inputs.target }}
restore-keys: llvm-${{ inputs.version }}-${{ inputs.arch }}-${{ inputs.os }}-${{ inputs.target }}
key: llvm-${{ inputs.version }}-${{ inputs.arch }}-${{ inputs.os }}
restore-keys: llvm-${{ inputs.version }}-${{ inputs.arch }}-${{ inputs.os }}

- name: Linux - Install build dependencies, ninja
run: sudo apt-get install -y ninja-build
Expand Down Expand Up @@ -53,13 +50,12 @@ runs:
Write-Output "RSQL_LLVM_FEATURE_VERSION=llvm${{ inputs.version }}-0" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh

- name: Working dir
- name: Reset working directory
run: pwd
shell: pwsh

- name: Install LLVM
run: |
pwd
./build.ps1 -t install-llvm-from-source
shell: pwsh
if: ${{ steps.cache-llvm.outputs.cache-hit != 'true' }}
35 changes: 0 additions & 35 deletions .github/workflows/build.yaml

This file was deleted.

42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on:
pull_request:
branches: [main, develop]
workflow_dispatch:
release:

permissions:
contents: write
actions: write
pull-requests: write

run-name: Build from ${{ github.ref }}

jobs:
build:
name: Run full build and unit tests.
runs-on: [ubuntu-latest]

steps:
- uses: actions/checkout@v4
- name: Setup rust toolchain
uses: ./.github/actions/rust-toolchain
with:
toolchain: 1.75.0
components: rustfmt clippy
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
if: ${{ runner.os != 'macos-14' }}
- name: Install LLVM
uses: ./.github/actions/install-llvm
with:
version: "14"
os: ${{ runner.os }}
directory: ${{ github.workspace }}/target/llvm
- name: "Running build script."
run: |
./build.ps1
shell: pwsh
File renamed without changes.
12 changes: 2 additions & 10 deletions .github/workflows/deploy-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,21 @@ on:
jobs:
deploy:
runs-on: ${{ matrix.config.os }}
env: ${{ matrix.config.env }}
strategy:
fail-fast: false
matrix:
config:
- {
os: "ubuntu-20.04",
arch: "amd64",
target: "pypi-build",
env: { },
}
- {
os: "windows-2019",
arch: "amd64",
target: "pypi-build",
env: { },
}
- {
os: "macos-14",
arch: "arm64",
target: "pypi-build",
env: { },
}
steps:
- uses: actions/checkout@v4
Expand All @@ -47,11 +40,10 @@ jobs:
version: "14"
os: ${{ matrix.config.os }}
directory: ${{ github.workspace }}/target/llvm
target: ${{ matrix.config.target }}
- name: "Build ${{ matrix.config.target }}"
- name: "Building Rasqal using pypi-build."
run: |
pwd
./build.ps1 -t ${{ matrix.config.target }}
./build.ps1 -t "pypi-build"
shell: pwsh
- name: Artifacts - manylinux
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion building.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ When these tools have been downloaded you run `build.ps1` at `/src/build.ps1`. T
From this point you can build the Rust project with cargo and deal with it seperately.
But if you need to redeploy the wheel and test things from Python you need to run the build script again.

If you have issues you can look at the [CI cross-OS build script](https://github.com/oqc-community/rasqal/blob/develop/.github/workflows/deploy-wheels.yaml) and see what might be missing or out of date from the documentation.
If you have issues you can look at the [CI cross-OS build script](https://github.com/oqc-community/rasqal/blob/develop/.github/workflows/deploy-wheels.yml) and see what might be missing or out of date from the documentation.

#### Building LLVM from source

Expand Down

0 comments on commit 0b985fc

Please sign in to comment.