name: Rust
on:
push:
pull_request:
jobs:
stable:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install toolchain
run: |
# install rust/cargo
rustup component add rustfmt
# install nd-triangulator
sudo apt-get install g++
sudo apt-get install libcgal-dev
sudo apt-get install libeigen3-dev
# install multi-ch-constructor
sudo apt-get install libboost-all-dev
sudo apt-get install libglpk-dev
- name: Build
run: |
cargo build --verbose
cargo build --release --verbose
- name: Run tests
run: |
cargo test --verbose
cargo test --verbose --features='gpl'
cargo fmt -- --check
- name: Run binaries
run: |
cargo run --release --bin osmgraphing -- --config resources/isle_of_man_2020-03-14/osm.pbf.yaml
GRAPH_DIM=6 cargo run --release --features='gpl' --bin osmgraphing -- --config resources/isle_of_man_2020-03-14/balancing/config.yaml --balancing
- name: Build docs
run: cargo doc
beta:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install toolchain
run: |
# install rust/cargo
rustup toolchain install beta
rustup default beta
# install nd-triangulator
sudo apt-get install g++
sudo apt-get install libcgal-dev
sudo apt-get install libeigen3-dev
# install multi-ch-constructor
sudo apt-get install libboost-all-dev
sudo apt-get install libglpk-dev
- name: Build
run: |
cargo build --verbose
cargo build --release --verbose
- name: Run tests
run: |
cargo test --verbose
cargo test --verbose --features='gpl'
- name: Run binaries
run: |
cargo run --release --bin osmgraphing -- --config resources/isle_of_man_2020-03-14/osm.pbf.yaml
GRAPH_DIM=6 cargo run --release --features='gpl' --bin osmgraphing -- --config resources/isle_of_man_2020-03-14/balancing/config.yaml --balancing
nightly:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
continue-on-error: true
- name: Install
run: |
# install rust/cargo
rustup toolchain install nightly
rustup default nightly
# install nd-triangulator
sudo apt-get install g++
sudo apt-get install libcgal-dev
sudo apt-get install libeigen3-dev
# install multi-ch-constructor
sudo apt-get install libboost-all-dev
sudo apt-get install libglpk-dev
continue-on-error: true
- name: Build
run: |
cargo build --verbose
cargo build --release --verbose
continue-on-error: true
- name: Run tests
run: |
cargo test --verbose
cargo test --verbose --features='gpl'
- name: Run binaries
run: |
cargo run --release --bin osmgraphing -- --config resources/isle_of_man_2020-03-14/osm.pbf.yaml
GRAPH_DIM=6 cargo run --release --features='gpl' --bin osmgraphing -- --config resources/isle_of_man_2020-03-14/balancing/config.yaml --balancing
continue-on-error: true
benches:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Run benchmarks
run: cargo bench
- name: Prepare upload
run: |
artifacts="artifacts/$(git rev-parse --verify HEAD)"
mkdir -p "${artifacts}"
mv target/criterion/ "${artifacts}/"
- name: Upload results
uses: actions/upload-artifact@v1
with:
name: benches
path: artifacts/
deploy-and-tag:
if: github.ref == 'refs/heads/release'
runs-on: ubuntu-latest
needs: [stable, benches]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Setup git-user
env:
GIT_USER_NAME: 'GitHub Actions'
GIT_USER_EMAIL: 'actions@users.noreply.github.com'
run: |
git config --global user.name "${GIT_USER_NAME}"
git config --global user.email "${GIT_USER_EMAIL}"
git fetch --all
- name: Deploy and tag
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
run: |
cargo publish --token "${CRATES_TOKEN}"
git tag --annotate "v$(cargo pkgid | cut -d# -f2 | cut -d: -f2)" --message='See CHANGELOG.md'
git push --tags