From 25035ab03d7a064d4a2c02b4d124607644328c2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Tue, 11 Jul 2023 09:43:31 +0200 Subject: [PATCH 01/15] Setup github actions with a reusable workflow --- .github/workflows/build-test-verify.yml | 54 +++++++++++++++++++++++++ .github/workflows/ci.yml | 26 ++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/workflows/build-test-verify.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/build-test-verify.yml b/.github/workflows/build-test-verify.yml new file mode 100644 index 00000000..64ae1111 --- /dev/null +++ b/.github/workflows/build-test-verify.yml @@ -0,0 +1,54 @@ +name: build-test-verify + +on: + workflow_call: + inputs: + runner: + required: false + type: string + default: ubuntu-latest + target: + required: true + type: string + rustflags: + required: false + type: string + default: '' + +jobs: + build-test-verify: + runs-on: ${{ inputs.runner }} + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Init Rustup Cache + uses: actions/cache@v2 + with: + path: | + ~/.rustup/toolchains + key: ${{ runner.os }}-cargo-${{ hashFiles('**/rust-toolchain') }} + - name: Install Toolchain + uses: actions-rs/toolchain@v1 + with: + target: ${{ inputs.target }} + toolchain: nightly + override: true + default: true + - name: Generate Lockfile + run: cargo generate-lockfile + - name: Init Cargo Cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + # should hash Cargo.lock, + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Run CI + run: ci/run-docker.sh + env: + TARGET: ${{ inputs.target }} + RUSTFLAGS: ${{ inputs.rustflags }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f06cc794 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: rust + +# trigger for all PRs and changes to master +on: + push: + branches: + - master + - port-ci-to-github-actions # during testing + pull_request: + +jobs: + x86_64-unknown-linux-android-SSE2: + name: "x86_64-unknown-linux-android + SSE2" + uses: ./.github/workflows/build-test-verify.yml + with: + target: x86_64-linux-android + i586-unknown-linux-gnu: + uses: ./.github/workflows/build-test-verify.yml + with: + target: i586-unknown-linux-gnu + x86_64-unknown-linux-gnu-SSE4_2: + name: "x86_64-unknown-linux-gnu + SSE4.2" + uses: ./.github/workflows/build-test-verify.yml + with: + target: x86_64-unknown-linux-gnu + rustflags: "-C target-feature=+sse4.2" From 704e6490890f235192ae9b2becddf9e0d39d01ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Tue, 11 Jul 2023 10:05:27 +0200 Subject: [PATCH 02/15] Older nightly because of compile error --- rust-toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain b/rust-toolchain index 07ade694..0215e075 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly \ No newline at end of file +nightly-2023-06-14 \ No newline at end of file From 4256940332c83bd7cdf4572f133e0eae56e93751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Tue, 11 Jul 2023 10:19:45 +0200 Subject: [PATCH 03/15] Don't set toolchain in action --- .github/workflows/build-test-verify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-verify.yml b/.github/workflows/build-test-verify.yml index 64ae1111..97321a92 100644 --- a/.github/workflows/build-test-verify.yml +++ b/.github/workflows/build-test-verify.yml @@ -31,7 +31,7 @@ jobs: uses: actions-rs/toolchain@v1 with: target: ${{ inputs.target }} - toolchain: nightly + #toolchain: nightly override: true default: true - name: Generate Lockfile From aaf584c58d8388951067e74764278a91da3120ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Tue, 11 Jul 2023 10:23:16 +0200 Subject: [PATCH 04/15] Change doc tests refering to packed_simd_2 --- src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 277cc818..c28c569f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -26,7 +26,7 @@ //! are applied to each vector lane in isolation of the others: //! //! ``` -//! # use packed_simd_2::*; +//! # use packed_simd::*; //! let a = i32x4::new(1, 2, 3, 4); //! let b = i32x4::new(5, 6, 7, 8); //! assert_eq!(a + b, i32x4::new(6, 8, 10, 12)); @@ -35,7 +35,7 @@ //! Many "horizontal" operations are also provided: //! //! ``` -//! # use packed_simd_2::*; +//! # use packed_simd::*; //! # let a = i32x4::new(1, 2, 3, 4); //! assert_eq!(a.wrapping_sum(), 10); //! ``` @@ -47,7 +47,7 @@ //! and performing a single horizontal operation at the end: //! //! ``` -//! # use packed_simd_2::*; +//! # use packed_simd::*; //! fn reduce(x: &[i32]) -> i32 { //! assert_eq!(x.len() % 4, 0); //! let mut sum = i32x4::splat(0); // [0, 0, 0, 0] @@ -79,7 +79,7 @@ //! ## Basic operations //! //! ``` -//! # use packed_simd_2::*; +//! # use packed_simd::*; //! // Sets all elements to `0`: //! let a = i32x4::splat(0); //! @@ -107,7 +107,7 @@ //! to be performed: //! //! ``` -//! # use packed_simd_2::*; +//! # use packed_simd::*; //! let a = i32x4::new(1, 1, 2, 2); //! //! // Add `1` to the first two lanes of the vector. @@ -140,7 +140,7 @@ //! All vertical comparison operations returns masks: //! //! ``` -//! # use packed_simd_2::*; +//! # use packed_simd::*; //! let a = i32x4::new(1, 1, 3, 3); //! let b = i32x4::new(2, 2, 0, 0); //! @@ -279,7 +279,7 @@ pub use crate::sealed::{Mask, Shuffle, Simd as SimdVector, SimdArray}; /// # Examples /// /// ``` -/// # use packed_simd_2::Simd; +/// # use packed_simd::Simd; /// let v = Simd::<[i32; 4]>::new(0, 1, 2, 3); /// assert_eq!(v.extract(2), 2); /// ``` From ceecf667e718b10db62f2aaae91f7246d4d15988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Tue, 11 Jul 2023 11:50:58 +0200 Subject: [PATCH 05/15] Skip examples --- ci/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci/run.sh b/ci/run.sh index 428a5d89..b1b22ebd 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -95,4 +95,5 @@ if [[ "${NOVERIFY}" != "1" ]]; then cargo_test --release --manifest-path=target/verify/Cargo.toml fi -. ci/run_examples.sh +# FIXME: Figure out which examples take too long to run and ignore or adjust those +#. ci/run_examples.sh From b7ef46d771ee8c813922be83738ff3b08f55afc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Tue, 11 Jul 2023 11:59:24 +0200 Subject: [PATCH 06/15] Fix target features for avx512 rotate tests --- verify/verify/src/api/ops/vector_rotates/x86.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/verify/verify/src/api/ops/vector_rotates/x86.rs b/verify/verify/src/api/ops/vector_rotates/x86.rs index 9d4e2412..bfa8dc45 100644 --- a/verify/verify/src/api/ops/vector_rotates/x86.rs +++ b/verify/verify/src/api/ops/vector_rotates/x86.rs @@ -4,14 +4,14 @@ mod u64x8 { use stdarch_test::assert_instr; #[inline] - #[target_feature(enable = "avx512f,avx512vl")] + #[target_feature(enable = "avx512f")] #[assert_instr(vpro)] unsafe fn rotate_right_variable(x: u64x8, v: u64x8) -> u64x8 { x.rotate_right(v) } #[inline] - #[target_feature(enable = "avx512f,avx512vl")] + #[target_feature(enable = "avx512f")] #[assert_instr(vpro)] unsafe fn rotate_left_variable(x: u64x8, v: u64x8) -> u64x8 { x.rotate_left(v) @@ -32,7 +32,7 @@ mod u64x8 { } #[inline] - #[target_feature(enable = "avx512f")] + #[target_feature(enable = "avx512f,avx512vl")] #[assert_instr(vpro)] unsafe fn rotate_left_x2(x: u64x2) -> u64x2 { x.rotate_left(u64x2::splat(12)) From 30b2f18e704f91907a5f8eaa471c342b4e314cbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Tue, 11 Jul 2023 15:40:01 +0200 Subject: [PATCH 07/15] Manually list target and rustflags combinations --- .github/workflows/build-test-verify.yml | 9 +- .github/workflows/ci.yml | 231 +++++++++++++++++++++++- 2 files changed, 233 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-test-verify.yml b/.github/workflows/build-test-verify.yml index 97321a92..a24df0a9 100644 --- a/.github/workflows/build-test-verify.yml +++ b/.github/workflows/build-test-verify.yml @@ -14,6 +14,10 @@ on: required: false type: string default: '' + script: + required: false + type: string + default: ci/run-docker.sh jobs: build-test-verify: @@ -31,9 +35,9 @@ jobs: uses: actions-rs/toolchain@v1 with: target: ${{ inputs.target }} - #toolchain: nightly override: true default: true + components: rustfmt - name: Generate Lockfile run: cargo generate-lockfile - name: Init Cargo Cache @@ -45,10 +49,9 @@ jobs: ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - # should hash Cargo.lock, key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run CI - run: ci/run-docker.sh + run: ${{ inputs.script }} env: TARGET: ${{ inputs.target }} RUSTFLAGS: ${{ inputs.rustflags }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f06cc794..292db87f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,18 +9,241 @@ on: pull_request: jobs: - x86_64-unknown-linux-android-SSE2: - name: "x86_64-unknown-linux-android + SSE2" + x86_64-unknown-linux-android: uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true with: target: x86_64-linux-android + arm-linux-androideabi: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + target: arm-linux-androideabi + aarch64-unknown-linux-android-NEON: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + target: aarch64-linux-android + rustflags: -Ctarget-feature=+neon + thumbv7neon-linux-androideabi: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: thumbv7neon-linux-androideabi i586-unknown-linux-gnu: uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: i586-unknown-linux-gnu + i586-unknown-linux-gnu-SSE: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: i586-unknown-linux-gnu + rustflags: -Ctarget-feature=+sse + i586-unknown-linux-gnu-SSE2: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false with: target: i586-unknown-linux-gnu + rustflags: -Ctarget-feature=+sse2 + i686-unknown-linux-gnu: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: i686-unknown-linux-gnu + i686-unknown-linux-gnu-SSE4_2: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: i686-unknown-linux-gnu + rustflags: -Ctarget-feature=+sse4.2 + i686-unknown-linux-gnu-AVX2: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: i686-unknown-linux-gnu + rustflags: -Ctarget-feature=+avx2 + x86_64-unknown-linux-gnu: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + target: x86_64-unknown-linux-gnu x86_64-unknown-linux-gnu-SSE4_2: - name: "x86_64-unknown-linux-gnu + SSE4.2" uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true with: target: x86_64-unknown-linux-gnu - rustflags: "-C target-feature=+sse4.2" + rustflags: -Ctarget-feature=+sse4.2 + x86_64-unknown-linux-gnu-AVX2: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + target: x86_64-unknown-linux-gnu + rustflags: -Ctarget-feature=+avx2 + arm-unknown-linux-gnueabihf: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + target: arm-unknown-linux-gnueabihf + armv7-unknown-linux-gnueabihf: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + target: armv7-unknown-linux-gnueabihf + armv7-unknown-linux-gnueabihf-NEON: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + target: armv7-unknown-linux-gnueabihf + rustflags: -Ctarget-feature=+neon + thumbv7neon-unknown-linux-gnueabihf: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: thumbv7neon-unknown-linux-gnueabihf + aarch64-unknown-linux-gnu-NEON: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + target: aarch64-unknown-linux-gnu + rustflags: -Ctarget-feature=+neon + mips-unknown-linux-gnu: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: mips-unknown-linux-gnu + mipsel-unknown-linux-musl: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: mipsel-unknown-linux-musl + mips64-unknown-linux-gnuabi64: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: mips64-unknown-linux-gnuabi64 + mipsel64-unknown-linux-gnuabi64: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: mipsel64-unknown-linux-gnuabi64 + powerpc-unknown-linux-gnu: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: powerpc-unknown-linux-gnu + powerpc64-unknown-linux-gnu: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: powerpc64-unknown-linux-gnu + powerpc64le-unknown-linux-gnu: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + target: powerpc64le-unknown-linux-gnu + powerpc64le-unknown-linux-gnu-ALTIVEC: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + target: powerpc64le-unknown-linux-gnu + rustflags: -Ctarget-feature=+altivec + powerpc64le-unknown-linux-gnu-VSX: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + target: powerpc64le-unknown-linux-gnu + rustflags: -Ctarget-feature=+vsx + s390x-unknown-linux-gnu: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: s390x-unknown-linux-gnu + sparc64-unknown-linux-gnu: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: sparc64-unknown-linux-gnu + wasm32-unknown-unknown: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: false + with: + target: wasm32-unknown-unknown + x86_64-apple-darwin-SSE4_2: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + runner: macos-latest + script: ci/run.sh + target: x86_64-apple-darwin + rustflags: -Ctarget-feature=+sse4.2 + x86_64-apple-darwin-AVX: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + runner: macos-latest + script: ci/run.sh + target: x86_64-apple-darwin + rustflags: -Ctarget-feature=+avx + x86_64-apple-ios: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + runner: macos-latest + script: ci/run.sh + target: x86_64-apple-ios + aarch-apple-ios: + uses: ./.github/workflows/build-test-verify.yml + strategy: + fail-fast: true + with: + runner: macos-latest + script: ci/run.sh + target: aarch-apple-ios + rustflags: -Ctarget-feature=+neon + + + + + + + + + + + + From aa96360c82436ad66d1ea6ed3f89d600af875d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Tue, 11 Jul 2023 16:55:59 +0200 Subject: [PATCH 08/15] Disable position independent code on i586 and i686 to make verify tests pass --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 292db87f..e2a6d01c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,40 +40,42 @@ jobs: fail-fast: false with: target: i586-unknown-linux-gnu + rustflags: -Crelocation-model=static i586-unknown-linux-gnu-SSE: uses: ./.github/workflows/build-test-verify.yml strategy: fail-fast: false with: target: i586-unknown-linux-gnu - rustflags: -Ctarget-feature=+sse + rustflags: -Crelocation-model=static -Ctarget-feature=+sse i586-unknown-linux-gnu-SSE2: uses: ./.github/workflows/build-test-verify.yml strategy: fail-fast: false with: target: i586-unknown-linux-gnu - rustflags: -Ctarget-feature=+sse2 + rustflags: -Crelocation-model=static -Ctarget-feature=+sse2 i686-unknown-linux-gnu: uses: ./.github/workflows/build-test-verify.yml strategy: fail-fast: false with: target: i686-unknown-linux-gnu + rustflags: -Crelocation-model=static i686-unknown-linux-gnu-SSE4_2: uses: ./.github/workflows/build-test-verify.yml strategy: fail-fast: false with: target: i686-unknown-linux-gnu - rustflags: -Ctarget-feature=+sse4.2 + rustflags: -Crelocation-model=static -Ctarget-feature=+sse4.2 i686-unknown-linux-gnu-AVX2: uses: ./.github/workflows/build-test-verify.yml strategy: fail-fast: false with: target: i686-unknown-linux-gnu - rustflags: -Ctarget-feature=+avx2 + rustflags: -Crelocation-model=static -Ctarget-feature=+avx2 x86_64-unknown-linux-gnu: uses: ./.github/workflows/build-test-verify.yml strategy: From 862c2eca5cf832da40ef9f67b22f65967c4984e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Tue, 11 Jul 2023 17:56:04 +0200 Subject: [PATCH 09/15] Add timeout to job --- .github/workflows/build-test-verify.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-test-verify.yml b/.github/workflows/build-test-verify.yml index a24df0a9..424f1634 100644 --- a/.github/workflows/build-test-verify.yml +++ b/.github/workflows/build-test-verify.yml @@ -51,6 +51,7 @@ jobs: target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run CI + timeout-minutes: 15 run: ${{ inputs.script }} env: TARGET: ${{ inputs.target }} From 8ef08500351bd6fc8dcb443d33e5fb3f96bf53aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Tue, 11 Jul 2023 18:37:11 +0200 Subject: [PATCH 10/15] Reuse action for docs and benchmarks --- .github/workflows/benchmarks.yml | 30 +++++++ .github/workflows/ci.yml | 88 +++++++++---------- .github/workflows/docs.yml | 14 +++ ...uild-test-verify.yml => run-ci-script.yml} | 38 ++++++-- 4 files changed, 117 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/benchmarks.yml create mode 100644 .github/workflows/docs.yml rename .github/workflows/{build-test-verify.yml => run-ci-script.yml} (60%) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml new file mode 100644 index 00000000..2fa25bc8 --- /dev/null +++ b/.github/workflows/benchmarks.yml @@ -0,0 +1,30 @@ +name: benchmarks + +on: + push: + branches: + - port-ci-to-github-actions # during testing + workflow_dispatch: + +jobs: + x86_64-unknown-linux-gnu: + uses: ./.github/workflows/run-ci-script.yml + with: + target: x86_64-unknown-linux-gnu + setup_script: ci/setup_benchmarks.sh + script: ci/benchmark.sh + norun: 1 + verify: 1 + # FIXME: figure out how to add downloaded ispc to PATH + # features: ispc + x86_64-apple-darwin: + uses: ./.github/workflows/run-ci-script.yml + with: + target: x86_64-apple-darwin + runner: macos-latest + setup_script: ci/setup_benchmarks.sh + script: ci/benchmark.sh + norun: 1 + verify: 1 + # FIXME: figure out how to add downloaded ispc to PATH + # features: ispc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2a6d01c..3d0507be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: rust +name: ci # trigger for all PRs and changes to master on: @@ -9,201 +9,205 @@ on: pull_request: jobs: + rustfmt: + uses: ./.github/workflows/run-ci-script.yml + with: + script: ci/all.sh check_fmt || true x86_64-unknown-linux-android: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: x86_64-linux-android arm-linux-androideabi: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: arm-linux-androideabi aarch64-unknown-linux-android-NEON: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: aarch64-linux-android rustflags: -Ctarget-feature=+neon thumbv7neon-linux-androideabi: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: thumbv7neon-linux-androideabi i586-unknown-linux-gnu: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: i586-unknown-linux-gnu rustflags: -Crelocation-model=static i586-unknown-linux-gnu-SSE: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: i586-unknown-linux-gnu rustflags: -Crelocation-model=static -Ctarget-feature=+sse i586-unknown-linux-gnu-SSE2: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: i586-unknown-linux-gnu rustflags: -Crelocation-model=static -Ctarget-feature=+sse2 i686-unknown-linux-gnu: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: i686-unknown-linux-gnu rustflags: -Crelocation-model=static i686-unknown-linux-gnu-SSE4_2: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: i686-unknown-linux-gnu rustflags: -Crelocation-model=static -Ctarget-feature=+sse4.2 i686-unknown-linux-gnu-AVX2: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: i686-unknown-linux-gnu rustflags: -Crelocation-model=static -Ctarget-feature=+avx2 x86_64-unknown-linux-gnu: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: x86_64-unknown-linux-gnu x86_64-unknown-linux-gnu-SSE4_2: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: x86_64-unknown-linux-gnu rustflags: -Ctarget-feature=+sse4.2 x86_64-unknown-linux-gnu-AVX2: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: x86_64-unknown-linux-gnu rustflags: -Ctarget-feature=+avx2 arm-unknown-linux-gnueabihf: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: arm-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: armv7-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf-NEON: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: armv7-unknown-linux-gnueabihf rustflags: -Ctarget-feature=+neon thumbv7neon-unknown-linux-gnueabihf: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: thumbv7neon-unknown-linux-gnueabihf aarch64-unknown-linux-gnu-NEON: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: aarch64-unknown-linux-gnu rustflags: -Ctarget-feature=+neon mips-unknown-linux-gnu: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: mips-unknown-linux-gnu mipsel-unknown-linux-musl: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: mipsel-unknown-linux-musl mips64-unknown-linux-gnuabi64: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: mips64-unknown-linux-gnuabi64 mipsel64-unknown-linux-gnuabi64: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: mipsel64-unknown-linux-gnuabi64 powerpc-unknown-linux-gnu: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: powerpc-unknown-linux-gnu powerpc64-unknown-linux-gnu: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: powerpc64-unknown-linux-gnu powerpc64le-unknown-linux-gnu: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: powerpc64le-unknown-linux-gnu powerpc64le-unknown-linux-gnu-ALTIVEC: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: powerpc64le-unknown-linux-gnu rustflags: -Ctarget-feature=+altivec powerpc64le-unknown-linux-gnu-VSX: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: target: powerpc64le-unknown-linux-gnu rustflags: -Ctarget-feature=+vsx s390x-unknown-linux-gnu: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: s390x-unknown-linux-gnu sparc64-unknown-linux-gnu: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: sparc64-unknown-linux-gnu wasm32-unknown-unknown: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: false with: target: wasm32-unknown-unknown x86_64-apple-darwin-SSE4_2: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: @@ -212,7 +216,7 @@ jobs: target: x86_64-apple-darwin rustflags: -Ctarget-feature=+sse4.2 x86_64-apple-darwin-AVX: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: @@ -221,7 +225,7 @@ jobs: target: x86_64-apple-darwin rustflags: -Ctarget-feature=+avx x86_64-apple-ios: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: @@ -229,23 +233,11 @@ jobs: script: ci/run.sh target: x86_64-apple-ios aarch-apple-ios: - uses: ./.github/workflows/build-test-verify.yml + uses: ./.github/workflows/run-ci-script.yml strategy: fail-fast: true with: runner: macos-latest script: ci/run.sh target: aarch-apple-ios - rustflags: -Ctarget-feature=+neon - - - - - - - - - - - - + rustflags: -Ctarget-feature=+neon \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..417a1deb --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,14 @@ +name: docs + +on: + push: + branches: + - master + - port-ci-to-github-actions # during testing + +jobs: + docs: + uses: ./.github/workflows/run-ci-script.yml + with: + setup_script: cargo install mdbook + script: ci/dox.sh diff --git a/.github/workflows/build-test-verify.yml b/.github/workflows/run-ci-script.yml similarity index 60% rename from .github/workflows/build-test-verify.yml rename to .github/workflows/run-ci-script.yml index 424f1634..b54cc582 100644 --- a/.github/workflows/build-test-verify.yml +++ b/.github/workflows/run-ci-script.yml @@ -1,4 +1,4 @@ -name: build-test-verify +name: run-ci-script on: workflow_call: @@ -8,8 +8,9 @@ on: type: string default: ubuntu-latest target: - required: true + required: false type: string + default: '' rustflags: required: false type: string @@ -18,9 +19,24 @@ on: required: false type: string default: ci/run-docker.sh + setup_script: + required: false + type: string + norun: + required: false + type: string + default: '' + verify: + required: false + type: string + default: '' + features: + required: false + type: string + default: '' jobs: - build-test-verify: + run-ci-script: runs-on: ${{ inputs.runner }} steps: - name: Checkout @@ -50,9 +66,21 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Run CI + - name: Setup + if: ${{ inputs.setup_script != '' }} + run: ${{ inputs.setup_script }} + env: + TARGET: ${{ inputs.target }} + RUSTFLAGS: ${{ inputs.rustflags }} + NORUN: ${{ inputs.norun }} + VERIFY: ${{ inputs.verify }} + FEATURES: ${{ inputs.features }} + - name: Run CI Script timeout-minutes: 15 run: ${{ inputs.script }} env: TARGET: ${{ inputs.target }} - RUSTFLAGS: ${{ inputs.rustflags }} \ No newline at end of file + RUSTFLAGS: ${{ inputs.rustflags }} + NORUN: ${{ inputs.norun }} + VERIFY: ${{ inputs.verify }} + FEATURES: ${{ inputs.features }} \ No newline at end of file From b0ccf65044d901d55573f695fc541f1cc04053a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Tue, 11 Jul 2023 19:25:55 +0200 Subject: [PATCH 11/15] actions-rs is unmaintained, switch to dtolnay/rust-toolchain --- .github/workflows/run-ci-script.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run-ci-script.yml b/.github/workflows/run-ci-script.yml index b54cc582..d4d405ff 100644 --- a/.github/workflows/run-ci-script.yml +++ b/.github/workflows/run-ci-script.yml @@ -48,11 +48,12 @@ jobs: ~/.rustup/toolchains key: ${{ runner.os }}-cargo-${{ hashFiles('**/rust-toolchain') }} - name: Install Toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@master with: - target: ${{ inputs.target }} - override: true - default: true + # FIXME: change to nightly once https://github.com/rust-lang/packed_simd/pull/350 is merged + # needs to be kept in sync with the toolchain files + toolchain: nightly-2023-06-14 + targets: ${{ inputs.target }} components: rustfmt - name: Generate Lockfile run: cargo generate-lockfile From 78b8a428e190dcaf5dee422c2d7f2e96c439e7db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Tue, 11 Jul 2023 21:41:17 +0200 Subject: [PATCH 12/15] Disable triggering on this branch --- .github/workflows/benchmarks.yml | 3 ++- .github/workflows/ci.yml | 1 - .github/workflows/docs.yml | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 2fa25bc8..2102661b 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -3,7 +3,8 @@ name: benchmarks on: push: branches: - - port-ci-to-github-actions # during testing + - master + pull_request: workflow_dispatch: jobs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d0507be..287e9a0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,6 @@ on: push: branches: - master - - port-ci-to-github-actions # during testing pull_request: jobs: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 417a1deb..54bdc240 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,7 +4,6 @@ on: push: branches: - master - - port-ci-to-github-actions # during testing jobs: docs: From 2cd3eeb897da8adebfef1836cd6274c6ac95ea94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Wed, 26 Jul 2023 14:01:22 +0200 Subject: [PATCH 13/15] Remove ci jobs for mips since it was dropped to a tier 3 target Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com> --- .github/workflows/ci.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 287e9a0a..032ba625 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,30 +131,6 @@ jobs: with: target: aarch64-unknown-linux-gnu rustflags: -Ctarget-feature=+neon - mips-unknown-linux-gnu: - uses: ./.github/workflows/run-ci-script.yml - strategy: - fail-fast: false - with: - target: mips-unknown-linux-gnu - mipsel-unknown-linux-musl: - uses: ./.github/workflows/run-ci-script.yml - strategy: - fail-fast: false - with: - target: mipsel-unknown-linux-musl - mips64-unknown-linux-gnuabi64: - uses: ./.github/workflows/run-ci-script.yml - strategy: - fail-fast: false - with: - target: mips64-unknown-linux-gnuabi64 - mipsel64-unknown-linux-gnuabi64: - uses: ./.github/workflows/run-ci-script.yml - strategy: - fail-fast: false - with: - target: mipsel64-unknown-linux-gnuabi64 powerpc-unknown-linux-gnu: uses: ./.github/workflows/run-ci-script.yml strategy: From 83f73be3a5e5bd77243b9549eabf85035ad719ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Wed, 26 Jul 2023 14:02:25 +0200 Subject: [PATCH 14/15] Remove trailing empty line Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 032ba625..813c42f6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -215,4 +215,4 @@ jobs: runner: macos-latest script: ci/run.sh target: aarch-apple-ios - rustflags: -Ctarget-feature=+neon \ No newline at end of file + rustflags: -Ctarget-feature=+neon From bfb6c7f59b22087ac3fdc71559059da7d4a8f268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Horstmann?= Date: Wed, 26 Jul 2023 14:03:04 +0200 Subject: [PATCH 15/15] Remove trailing empty line Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com> --- .github/workflows/run-ci-script.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-ci-script.yml b/.github/workflows/run-ci-script.yml index d4d405ff..28a2f0e1 100644 --- a/.github/workflows/run-ci-script.yml +++ b/.github/workflows/run-ci-script.yml @@ -84,4 +84,4 @@ jobs: RUSTFLAGS: ${{ inputs.rustflags }} NORUN: ${{ inputs.norun }} VERIFY: ${{ inputs.verify }} - FEATURES: ${{ inputs.features }} \ No newline at end of file + FEATURES: ${{ inputs.features }}