Skip to content

Commit

Permalink
Fix CI (#70)
Browse files Browse the repository at this point in the history
* Don't build workspace

* Indent

* Make sure Command isn't empty without Roblox feature flag

* Check roblox feature flag for subcommand

* Change to cfg-if

* Reference target outside

* cd into selene for all-features

* Change target directory

* Fix Windows path
  • Loading branch information
Kampfkarren authored Dec 21, 2019
1 parent 2c5536d commit 382e7e4
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 22 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,20 @@ jobs:
- uses: actions/checkout@v1
- name: Build (Lightweight)
run: |
cargo build --locked --release --verbose --bin selene --no-default-features
cd selene
cargo build --locked --release --verbose --no-default-features
New-Item release -ItemType "directory"
Move-Item .\target\release\selene.exe .\release\selene-light.exe
Move-Item ..\target\release\selene.exe .\release\selene-light.exe
- name: Build (All features)
run: |
cargo build --locked --release --bin selene --all-features
Move-Item .\target\release\selene.exe .\release\selene.exe
cd selene
cargo build --locked --release --all-features
Move-Item ..\target\release\selene.exe .\release\selene.exe
- name: Upload
uses: actions/upload-artifact@v1
with:
name: selene-windows
path: release
path: ./selene/release
build_mac:
runs-on: macos-latest
steps:
Expand All @@ -34,34 +36,38 @@ jobs:
- name: Build (Lightweight)
run: |
source $HOME/.cargo/env
cargo build --locked --release --verbose --bin selene --no-default-features
cd selene
cargo build --locked --release --verbose --no-default-features
mkdir release/
mv ./target/release/selene ./release/selene-light
mv ../target/release/selene ./release/selene-light
- name: Build (All features)
run: |
source $HOME/.cargo/env
cargo build --locked --release --bin selene --all-features
mv ./target/release/selene ./release/selene
cd selene
cargo build --locked --release --all-features
mv ../target/release/selene ./release/selene
- name: Upload
uses: actions/upload-artifact@v1
with:
name: selene-macos
path: release
path: ./selene/release
build_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build (Lightweight)
run: |
cargo build --locked --release --verbose --bin selene --no-default-features
cd selene
cargo build --locked --release --verbose --no-default-features
mkdir release/
mv ./target/release/selene ./release/selene-light
mv ../target/release/selene ./release/selene-light
- name: Build (All features)
run: |
cargo build --locked --release --bin selene --all-features
mv ./target/release/selene ./release/selene
cd selene
cargo build --locked --release --all-features
mv ../target/release/selene ./release/selene
- name: Upload
uses: actions/upload-artifact@v1
with:
name: selene-linux
path: release
path: ./selene/release
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions selene/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ edition = "2018"

[dependencies]
atty = "0.2"
cfg-if = "0.1"
codespan = { version = "0.4", features = ["serialization"] }
codespan-reporting = { version = "0.4", features = ["serialization"] }
full_moon = "0.4.0-rc.12"
Expand Down
16 changes: 10 additions & 6 deletions selene/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,18 @@ fn read_file(checker: &Checker<toml::value::Value>, filename: &Path) {
}

fn start(matches: opts::Options) {
if let Some(opts::Command::GenerateRobloxStd { deprecated }) = matches.command {
println!("Generating Roblox standard library...");
cfg_if::cfg_if! {
if #[cfg(feature = "roblox")] {
if let Some(opts::Command::GenerateRobloxStd { deprecated }) = matches.command {
println!("Generating Roblox standard library...");

if let Err(error) = generate_roblox_std(deprecated) {
error!("Couldn't create roblox standard library: {}", error);
}
if let Err(error) = generate_roblox_std(deprecated) {
error!("Couldn't create roblox standard library: {}", error);
}

return;
return;
}
}
}

*OPTIONS.write().unwrap() = Some(matches.clone());
Expand Down
8 changes: 7 additions & 1 deletion selene/src/opts.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use std::ffi::OsString;

use structopt::{clap::arg_enum, StructOpt};
use structopt::{
clap::{arg_enum, AppSettings},
StructOpt,
};

#[derive(Clone, Debug, StructOpt)]
#[structopt(rename_all = "kebab-case")]
Expand Down Expand Up @@ -73,6 +76,9 @@ pub enum Command {
#[structopt(long)]
deprecated: bool,
},

#[structopt(setting(AppSettings::Hidden))]
NonExhaustive,
}

arg_enum! {
Expand Down

0 comments on commit 382e7e4

Please sign in to comment.