Bump actions/upload-artifact from 3 to 4 #217
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
workflow_dispatch: | |
env: | |
RUSTFLAGS: -Ctarget-feature=+avx | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
steps: | |
- run: lscpu | |
if: matrix.os == 'ubuntu-latest' | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
target: wasm32-unknown-unknown | |
components: rustfmt, clippy | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: false | |
target: wasm32-unknown-unknown | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo fmt -- --check | |
- run: cargo clippy --workspace --all-features -- --deny warnings | |
- run: cargo clippy --all-features --target wasm32-unknown-unknown -- --deny warnings | |
- run: cargo build --workspace --release --all-features | |
- run: cargo test --workspace --release --all-features | |
- run: cargo +nightly build --workspace --release --all-features | |
- run: cargo +nightly test --workspace --release --all-features | |
- run: cargo +nightly bench --workspace --all-features | |
- name: wasm build and tests | |
if: matrix.os != 'windows-latest' | |
env: | |
RUSTFLAGS: -Ctarget-feature=-simd128 | |
run: | | |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
wasm-pack build -t web -s hanabi1224 --out-name annoy | |
wasm-pack test --node --release | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: temurin | |
java-version: 21 | |
- name: java Test | |
run: | | |
pushd java | |
./gradlew clean test | |
./gradlew clean build publishToMavenLocal | |
./gradlew copy-artifacts | |
./gradlew clean test | |
./gradlew clean build publishToMavenLocal | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "8.x" | |
- name: dotnet Test | |
run: | | |
dotnet test -c Release dotnet/RuAnnoy.Tests | |
- name: dotnet Build - Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
dotnet build -c Release dotnet/RuAnnoy-Batteries-Linux-x64 | |
dotnet pack -c Release dotnet/RuAnnoy-Batteries-Linux-x64 -o dotnet/artifacts | |
- name: dotnet Build - OSX | |
if: matrix.os == 'macos-latest' | |
run: | | |
dotnet build -c Release dotnet/RuAnnoy-Batteries-Darwin-x64 | |
dotnet pack -c Release dotnet/RuAnnoy-Batteries-Darwin-x64 -o dotnet/artifacts | |
- name: dotnet Build - Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
dotnet build -c Release dotnet/RuAnnoy-Batteries-Windows-x64 | |
dotnet build -c Release dotnet/RuAnnoy | |
dotnet pack -c Release dotnet/RuAnnoy -o dotnet/artifacts | |
dotnet pack -c Release dotnet/RuAnnoy-Batteries-Windows-x64 -o dotnet/artifacts | |
- name: Benchmarks - Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo sh -c 'wget -qO- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -' | |
sudo sh -c 'wget -qO- https://storage.googleapis.com/download.dartlang.org/linux/debian/dart_stable.list > /etc/apt/sources.list.d/dart_stable.list' | |
sudo apt-get update -y | |
sudo apt-get install dart -y | |
sudo ln -sf /usr/lib/dart/bin/dart /usr/bin/dart | |
pushd bench | |
./bench.sh | |
- uses: actions/upload-artifact@v4 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
name: npm | |
path: pkg/**/* | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dotnet/artifacts/*.nupkg | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dotnet/artifacts/*.snupkg | |
- uses: actions/upload-artifact@v4 | |
if: matrix.os == 'windows-latest' | |
with: | |
path: target/release/*.dll | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v4 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
path: target/release/*.so | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v4 | |
if: matrix.os == 'macos-latest' | |
with: | |
path: target/release/*.dylib | |
if-no-files-found: error | |
- uses: EmbarkStudios/cargo-deny-action@v1 | |
if: matrix.os == 'ubuntu-latest' | |
# - name: Cargo deny | |
# run: | | |
# cargo install cargo-deny | |
# cargo deny check | |
- name: Deploy nugets | |
if: github.ref == 'refs/heads/master' | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
shell: pwsh | |
run: | | |
pushd dotnet/artifacts | |
dotnet nuget push *.nupkg --skip-duplicate -s https://api.nuget.org/v3/index.json -k $env:NUGET_API_KEY ; exit 0 | |
web: | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -Ctarget-feature=-simd128 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
target: wasm32-unknown-unknown | |
override: true | |
- run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: latest | |
- run: pnpm -r i | |
- run: pnpm -r run build | |
- run: pnpm -r run lint | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: example-web | |
path: example/web/dist/**/* | |
if-no-files-found: error | |
codedov: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: llvm-tools-preview | |
- uses: taiki-e/install-action@cargo-llvm-cov | |
- run: cargo llvm-cov --all-features --lcov --output-path lcov.info | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: lcov.info | |
path: lcov.info | |
if-no-files-found: error | |
- name: Upload to codecov | |
run: | | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov -f lcov.info -Z |