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

Port ci from travis to github actions #352

Merged
merged 15 commits into from
Jul 26, 2023
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
31 changes: 31 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: benchmarks

on:
push:
branches:
- master
pull_request:
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
218 changes: 218 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
name: ci

# trigger for all PRs and changes to master
on:
push:
branches:
- master
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/run-ci-script.yml
strategy:
fail-fast: true
with:
target: x86_64-linux-android
arm-linux-androideabi:
uses: ./.github/workflows/run-ci-script.yml
strategy:
fail-fast: true
with:
target: arm-linux-androideabi
aarch64-unknown-linux-android-NEON:
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/run-ci-script.yml
strategy:
fail-fast: false
with:
target: thumbv7neon-linux-androideabi
i586-unknown-linux-gnu:
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/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/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/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/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/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/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/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/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/run-ci-script.yml
strategy:
fail-fast: true
with:
target: arm-unknown-linux-gnueabihf
armv7-unknown-linux-gnueabihf:
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/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/run-ci-script.yml
strategy:
fail-fast: false
with:
target: thumbv7neon-unknown-linux-gnueabihf
aarch64-unknown-linux-gnu-NEON:
uses: ./.github/workflows/run-ci-script.yml
strategy:
fail-fast: true
with:
target: aarch64-unknown-linux-gnu
rustflags: -Ctarget-feature=+neon
powerpc-unknown-linux-gnu:
uses: ./.github/workflows/run-ci-script.yml
strategy:
fail-fast: false
with:
target: powerpc-unknown-linux-gnu
powerpc64-unknown-linux-gnu:
uses: ./.github/workflows/run-ci-script.yml
strategy:
fail-fast: false
with:
target: powerpc64-unknown-linux-gnu
powerpc64le-unknown-linux-gnu:
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/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/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/run-ci-script.yml
strategy:
fail-fast: false
with:
target: s390x-unknown-linux-gnu
sparc64-unknown-linux-gnu:
uses: ./.github/workflows/run-ci-script.yml
strategy:
fail-fast: false
with:
target: sparc64-unknown-linux-gnu
wasm32-unknown-unknown:
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/run-ci-script.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/run-ci-script.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/run-ci-script.yml
strategy:
fail-fast: true
with:
runner: macos-latest
script: ci/run.sh
target: x86_64-apple-ios
aarch-apple-ios:
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
13 changes: 13 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: docs

on:
push:
branches:
- master

jobs:
docs:
uses: ./.github/workflows/run-ci-script.yml
with:
setup_script: cargo install mdbook
script: ci/dox.sh
87 changes: 87 additions & 0 deletions .github/workflows/run-ci-script.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: run-ci-script

on:
workflow_call:
inputs:
runner:
required: false
type: string
default: ubuntu-latest
target:
required: false
type: string
default: ''
rustflags:
required: false
type: string
default: ''
script:
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:
run-ci-script:
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: dtolnay/rust-toolchain@master
with:
# 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
- name: Init Cargo Cache
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- 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 }}
NORUN: ${{ inputs.norun }}
VERIFY: ${{ inputs.verify }}
FEATURES: ${{ inputs.features }}
3 changes: 2 additions & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly
nightly-2023-06-14
Loading