Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 2 additions & 16 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,8 @@ concurrency:

jobs:
seed-build-script:
runs-on: ubuntu-latest
name: Pre-seed static binaries' versions
steps:
- env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release download
-R cpp-linter/clang-tools-static-binaries
--pattern versions.json
--output versions.json
- name: Upload versions.json
uses: actions/upload-artifact@v7
with:
name: static-binary-versions
path: versions.json
if-no-files-found: error
uses: ./.github/workflows/pre-seed-versions.yml

build-bin:
needs: [seed-build-script]
Expand Down Expand Up @@ -83,7 +69,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true' || steps.validate.outputs.cache-valid == 'false'
uses: actions/download-artifact@v8
with:
name: static-binary-versions
name: ${{ needs.seed-build-script.outputs.artifact-name }}
path: clang-tools-manager
- run: cargo build --bin cpp-linter --features bin --release
if: steps.cache.outputs.cache-hit != 'true' || steps.validate.outputs.cache-valid == 'false'
Expand Down
18 changes: 2 additions & 16 deletions .github/workflows/binary-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,8 @@ concurrency:

jobs:
seed-build-script:
runs-on: ubuntu-latest
name: Pre-seed static binaries' versions
steps:
- env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release download
-R cpp-linter/clang-tools-static-binaries
--pattern versions.json
--output versions.json
- name: Upload versions.json
uses: actions/upload-artifact@v7
with:
name: static-binary-versions
path: versions.json
if-no-files-found: error
uses: ./.github/workflows/pre-seed-versions.yml

create-assets:
needs: [seed-build-script]
Expand Down Expand Up @@ -135,7 +121,7 @@ jobs:
- name: Restore build script seed
uses: actions/download-artifact@v8
with:
name: static-binary-versions
name: ${{ needs.seed-build-script.outputs.artifact-name }}
path: clang-tools-manager

- name: Build
Expand Down
20 changes: 3 additions & 17 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,8 @@ jobs:
- run: cargo fetch

seed-build-script:
runs-on: ubuntu-latest
name: Pre-seed static binaries' versions
steps:
- env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release download
-R cpp-linter/clang-tools-static-binaries
--pattern versions.json
--output versions.json
- name: Upload versions.json
uses: actions/upload-artifact@v7
with:
name: static-binary-versions
path: versions.json
if-no-files-found: error
uses: ./.github/workflows/pre-seed-versions.yml

build-mkdocs:
runs-on: ubuntu-latest
Expand All @@ -87,7 +73,7 @@ jobs:
- name: Restore build script seed
uses: actions/download-artifact@v8
with:
name: static-binary-versions
name: ${{ needs.seed-build-script.outputs.artifact-name }}
path: clang-tools-manager
- name: Build docs
run: nur docs --build
Expand Down Expand Up @@ -123,7 +109,7 @@ jobs:
- name: Restore build script seed
uses: actions/download-artifact@v8
with:
name: static-binary-versions
name: ${{ needs.seed-build-script.outputs.artifact-name }}
path: clang-tools-manager
- run: nur docs rs
- name: upload rustdoc build as artifact
Expand Down
20 changes: 3 additions & 17 deletions .github/workflows/node-js-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,8 @@ concurrency:

jobs:
seed-build-script:
runs-on: ubuntu-latest
name: Pre-seed static binaries' versions
steps:
- env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release download
-R cpp-linter/clang-tools-static-binaries
--pattern versions.json
--output versions.json
- name: Upload versions.json
uses: actions/upload-artifact@v7
with:
name: static-binary-versions
path: versions.json
if-no-files-found: error
uses: ./.github/workflows/pre-seed-versions.yml

build:
needs: [seed-build-script]
Expand Down Expand Up @@ -143,7 +129,7 @@ jobs:
- name: Restore build script seed
uses: actions/download-artifact@v8
with:
name: static-binary-versions
name: ${{ needs.seed-build-script.outputs.artifact-name }}
path: clang-tools-manager
- name: Build
run: ${{ matrix.settings.build }}
Expand Down Expand Up @@ -178,7 +164,7 @@ jobs:
- name: Restore build script seed
uses: actions/download-artifact@v8
with:
name: static-binary-versions
name: ${{ needs.seed-build-script.outputs.artifact-name }}
path: clang-tools-manager
- name: Build
shell: cpa.sh {0}
Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/pre-seed-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pre-seed versions

on:
workflow_call:
outputs:
artifact-name:
description: >-
The name of uploaded artifact containing the versions.json file.
value: static-binary-versions

Comment thread
coderabbitai[bot] marked this conversation as resolved.
permissions: {}

jobs:
pre-seed-versions:
runs-on: ubuntu-latest
steps:
- env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release download
-R cpp-linter/clang-tools-static-binaries
--pattern versions.json
--output versions.json
- name: Upload versions.json
uses: actions/upload-artifact@v7
with:
name: static-binary-versions
path: versions.json
if-no-files-found: error
37 changes: 5 additions & 32 deletions .github/workflows/python-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,8 @@ concurrency:

jobs:
seed-build-script:
runs-on: ubuntu-latest
name: Pre-seed static binaries' versions
steps:
- env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release download
-R cpp-linter/clang-tools-static-binaries
--pattern versions.json
--output versions.json
- name: Upload versions.json
uses: actions/upload-artifact@v7
with:
name: static-binary-versions
path: versions.json
if-no-files-found: error
uses: ./.github/workflows/pre-seed-versions.yml

linux:
needs: [seed-build-script]
Expand Down Expand Up @@ -93,31 +79,18 @@ jobs:
- name: Restore build script seed
uses: actions/download-artifact@v8
with:
name: static-binary-versions
name: ${{ needs.seed-build-script.outputs.artifact-name }}
path: clang-tools-manager
- name: Build wheels
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
with:
target: ${{ matrix.platform.target }}
# Use the zig toolchain for all targets except ppc64le.
# Note, this is meant to avoid build errors in aws-lc-sys crate, which compiles C code.
# Use the zig toolchain to avoid build errors in aws-lc-sys crate, which compiles C code.
args: >-
--release --out dist --find-interpreter --zig
# avoid cache-poisoning potential for actually distributed builds
sccache: ${{ startsWith(github.ref, 'refs/tags') && 'false' || 'true' }}
manylinux: 'auto'
# before-script-linux: |
# case "${{ matrix.platform.target }}" in
# ppc64le)
# apt-get update
# apt-get install -y \
# pkg-config \
# gcc-powerpc64le-linux-gnu \
# g++-powerpc64le-linux-gnu \
# binutils-powerpc64le-linux-gnu \
# libc6-dev-ppc64el-cross
# ;;
# esac
- name: Upload wheels
uses: actions/upload-artifact@v7
with:
Expand Down Expand Up @@ -145,7 +118,7 @@ jobs:
- name: Restore build script seed
uses: actions/download-artifact@v8
with:
name: static-binary-versions
name: ${{ needs.seed-build-script.outputs.artifact-name }}
path: clang-tools-manager
- name: Build wheels
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
Expand Down Expand Up @@ -180,7 +153,7 @@ jobs:
- name: Restore build script seed
uses: actions/download-artifact@v8
with:
name: static-binary-versions
name: ${{ needs.seed-build-script.outputs.artifact-name }}
path: clang-tools-manager
- name: Build wheels
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
Expand Down
18 changes: 2 additions & 16 deletions .github/workflows/run-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,8 @@ concurrency:

jobs:
seed-build-script:
runs-on: ubuntu-latest
name: Pre-seed static binaries' versions
steps:
- env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release download
-R cpp-linter/clang-tools-static-binaries
--pattern versions.json
--output versions.json
- name: Upload versions.json
uses: actions/upload-artifact@v7
with:
name: static-binary-versions
path: versions.json
if-no-files-found: error
uses: ./.github/workflows/pre-seed-versions.yml

test:
needs: [seed-build-script]
Expand Down Expand Up @@ -120,7 +106,7 @@ jobs:
- name: Restore build script seed
uses: actions/download-artifact@v8
with:
name: static-binary-versions
name: ${{ needs.seed-build-script.outputs.artifact-name }}
path: clang-tools-manager

- name: Run test suite
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: 'Close stale issues'
on:
schedule:
- cron: '30 1 * * *'
# Run at 1:30 AM every Monday, Wednesday, and Friday
- cron: '30 1 * * 1,3,5'

permissions: {}

Expand Down
20 changes: 20 additions & 0 deletions clang-tools-manager/src/downloader/hashing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,20 @@ use std::{fs, io::Read, num::NonZero, path::Path};
pub enum HashAlgorithm {
/// SHA-256 hash algorithm with the expected checksum value.
Sha256(String),

/// BLAKE2b-256 hash algorithm with the expected checksum value.
Blake2b256(String),

/// SHA-512 hash algorithm with the expected checksum value.
#[cfg(any(
// Windows support is only for x86_64 architecture (for now)
all(target_os = "windows", target_arch = "x86_64"),
// Linux and macOS support only x86_64 and aarch64 architectures
all(
any(target_os = "linux", target_os = "macos"),
any(target_arch = "x86_64", target_arch = "aarch64")
),
))]
Sha512(String),
}

Expand Down Expand Up @@ -74,6 +85,15 @@ impl HashAlgorithm {
let hasher = Blake2b::<U32>::new();
Self::hash_file(hasher, file_path, expected)
}
#[cfg(any(
// Windows support is only for x86_64 architecture (for now)
all(target_os = "windows", target_arch = "x86_64"),
// Linux and macOS support only x86_64 and aarch64 architectures
all(
any(target_os = "linux", target_os = "macos"),
any(target_arch = "x86_64", target_arch = "aarch64")
),
))]
HashAlgorithm::Sha512(expected) => {
use sha2::{Digest, Sha512};

Expand Down
Loading
Loading