Skip to content

Commit

Permalink
install osmium in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
HKalbasi committed Sep 4, 2023
1 parent 333d624 commit 9f7a542
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ jobs:
- uses: actions/checkout@v3
- name: Install Rust nightly
run: rustup toolchain install nightly
- name: Install osmium
run: cargo xtask install-osmium
- run: cargo xtask ci
20 changes: 20 additions & 0 deletions xtask/src/install_osmium.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use anyhow::{Context, Result};
use xshell::{cmd, Shell};

pub fn main() -> Result<()> {
let sh = &Shell::new()?;
let tmp = sh.create_temp_dir()?;
sh.change_dir(tmp.path());
cmd!(sh, "git clone https://github.com/osmcode/libosmium").run()?;
cmd!(
sh,
"apt install cmake cmake-curses-gui make libexpat1-dev zlib1g-dev libbz2-dev libboost-dev libprotobuf-dev protobuf-compiler libosmpbf-dev libprotozero-dev libutfcpp-dev"
).run()?;
sh.change_dir("libosmium");
cmd!(sh, "mkdir build").run()?;
sh.change_dir("build");
cmd!(sh, "cmake ..").run()?;
cmd!(sh, "make -j").run()?;
cmd!(sh, "make install").run()?;
Ok(())
}
3 changes: 3 additions & 0 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
use clap::Parser;

mod ci;
mod install_osmium;

#[derive(Parser)]
enum Command {
CI,
InstallOsmium,
}

fn main() -> anyhow::Result<()> {
let cmd = Command::parse();
match cmd {
Command::CI => ci::main(),
Command::InstallOsmium => install_osmium::main(),
}
}

0 comments on commit 9f7a542

Please sign in to comment.