chore: Fix sync_publish.sh script #55
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: ci | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
test: | |
name: test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: [nightly] # This should be reverted back to [stable, nightly] when 1.74 is made the rustc stable version | |
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: Use cache | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/bin | |
key: ${{ runner.os }}-${{ matrix.rust }} | |
- name: Install Rust | |
uses: hecrj/setup-rust-action@v1 | |
with: | |
rust-version: ${{ matrix.rust }} | |
- uses: Swatinem/rust-cache@v2 | |
- run: echo "$HOME/bin" >> $GITHUB_PATH | |
- run: mkdir -p $HOME/bin | |
- name: Setup tools | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: | | |
# ./scripts/install_sccache.sh $TARGET | |
source ~/.cargo/env || true | |
./scripts/install_mdbook.sh $TARGET | |
- name: Run tests | |
run: | | |
if [ ! -z $DISABLE_TESTS ]; then | |
return | |
elif [[ -z ${WASM+set} ]]; then | |
mdbook build book | |
./scripts/ci.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 |