Skip to content

Commit

Permalink
Merge pull request #917 from gluon-lang/workflows
Browse files Browse the repository at this point in the history
Switch to github actions
  • Loading branch information
Marwes authored Oct 3, 2021
2 parents b0ebf42 + a69cc14 commit ec9ffdc
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 19 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
# Only run deployment on git tags
- CURRENT_TAG=`git describe --exact-match --abbrev=0 --tags || true`
- >
if [[ $CURRENT_TAG != "" ]]; then
export GIT_HASH=$(git rev-parse HEAD)
sh scripts/before_deploy.sh
fi
52 changes: 52 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: ci
on:
pull_request:
push:
branches:
- master
jobs:
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [stable]
include:
- build: stable
os: ubuntu-latest
rust: stable
env:
CRATE_NAME: gluon
CARGO_INCREMENTAL: 0 # Incremental compilation is slower and bloats the cache
RUST_BACKTRACE: 1
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 500M
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install Rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- uses: Swatinem/rust-cache@v1
- run: echo "$HOME/bin" >> $GITHUB_PATH
- run: mkdir -p $HOME/bin
- run: ./scripts/install_sccache.sh $TARGET
- run: sh scripts/install_cross.sh
- run: source ~/.cargo/env || true
- run: ./scripts/install_mdbook.sh $TARGET
- name: Run tests
run: >
if [ ! -z $DISABLE_TESTS ]; then
return
elif [[ -z ${WASM+set} ]]; then
mdbook build book
./scripts/travis.sh
if ! git diff-index HEAD --; then
echo "Detected changes in the source after running tests"
exit 1
fi
else
rustup target add wasm32-unknown-unknown
cargo check --target wasm32-unknown-unknown -p gluon_c-api
fi
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<a name="v0.18.1"></a>
## v0.18.1 (2021-10-03)

* Fix compilation of `gluon` with the `tokio` feature enabled

<a name="v0.18.0"></a>
## v0.18.0 (2021-10-03)

Expand Down Expand Up @@ -1092,7 +1097,7 @@ Type errors should now be formatted much better and have more precise types.
<a name="v0.4.0"></a>
## v0.4.0 (2017-05-16)

Version 0.4.0 is a primarily a bug fix release with only a single significant feature as the upcoming features are all still WIP.
Version 0.4.0 is a primarily a bug fix release with only a single significant feature as the upcoming features are all still WIP.

#### Features

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gluon"
version = "0.18.0" # GLUON
version = "0.18.1" # GLUON
authors = ["Markus <marwes91@gmail.com>"]
keywords = ["script", "scripting", "language"]
build = "build.rs"
Expand Down Expand Up @@ -49,7 +49,7 @@ serde = { version = "1.0.130", optional = true }
serde_state = { version = "0.4.8", optional = true }
serde_derive_state = { version = "0.4.10", optional = true }

tokio = { version = "1.12.0", features = ["sync"], optional = true }
tokio = { version = "1.12.0", features = ["sync", "rt"], optional = true }
tokio-stream = { version = "0.1", features = ["net"], optional = true }

# Binding crates
Expand Down
8 changes: 4 additions & 4 deletions base/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,10 +1037,6 @@ where
}
}

#[cfg(target_pointer_width = "64")]
// Safeguard against accidentally growing Type as it is a core type
const _: [(); 8 * 6] = [(); std::mem::size_of::<Type<Symbol, ArcType>>()];

impl<Id, T> Type<Id, T>
where
T: TypePtr<Id = Id>,
Expand Down Expand Up @@ -4628,6 +4624,10 @@ where
mod tests {
use super::*;

#[cfg(target_pointer_width = "64")]
// Safeguard against accidentally growing Type as it is a core type
const _: [(); 8 * 6] = [(); std::mem::size_of::<Type<Symbol, ArcType>>()];

#[test]
fn walk_move_types_test() {
assert_eq!(
Expand Down
11 changes: 2 additions & 9 deletions scripts/install_cross.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
set -ex

main() {
local target=
if [ $TRAVIS_OS_NAME = linux ]; then
target=x86_64-unknown-linux-musl
sort=sort
else
target=x86_64-apple-darwin
sort=gsort # for `sort --sort-version`, from brew's coreutils.
fi
local target=x86_64-unknown-linux-musl

# This fetches latest stable release
local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \
| cut -d/ -f3 \
| grep -E '^v[0.1.0-9.]+$' \
| $sort --version-sort \
| sort --version-sort \
| tail -n1)
curl -LSfs https://japaric.github.io/trust/install.sh | \
sh -s -- \
Expand Down
3 changes: 2 additions & 1 deletion scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ for PROJECT in "${PROJECTS[@]}"
do
PROJECT_PATH=$(echo "$PROJECT" | sed 's/gluon_//' | sed 's/gluon/./')

if ! (sync_publish "${PROJECT_PATH}" -f "$@"); then
if ! (./scripts/sync_publish.sh "$(pwd)/${PROJECT_PATH}" -f "$@"); then
echo "Failed to publish $PROJECT_PATH"
exit 1
fi
done
2 changes: 1 addition & 1 deletion scripts/sync_publish.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ TMP_DIR=/tmp/test1
DIR="$1"
FORCE="$2"

NAME=$(grep '^name' "$DIR/Cargo.toml" | sed 's/name = "\([^"]*\)"/\1/')
NAME=$(grep '^name' "$DIR/Cargo.toml" | head -n 1 | sed 's/name = "\([^"]*\)"/\1/')
cd "$DIR"

VERSION=$(cargo metadata --format-version 1 2>/dev/null | jq -r '.packages[] | select(.name=="'$NAME'").version')
Expand Down

0 comments on commit ec9ffdc

Please sign in to comment.