added output cache, changed cache key, reordering
-name: Wasm Examples
+name: Build and test examples
on:
schedule:
@@ -18,6 +18,23 @@ jobs:
with:
ref: ${{ github.event.inputs.ref }}
+ - name: Install stable toolchain
+ uses: actions-rs/toolchain@v1
+ with:
+ toolchain: stable
+ override: true
+
+ - name: Debug 1
+ run: |
+ jq --help
+
+ - name: Debug 2
+ run: |
+ echo $GITHUB_JOB
+
+ - name: Get current date
+ run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
+
- name: Cache cargo
uses: actions/cache@v2.1.4
with:
@@ -28,18 +45,24 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
# Add date to the cache to keep it up to date
- key: ${{ matrix.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
+ key: ubuntu-latest-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
# Restore from outdated cache for speed
restore-keys: |
- ${{ matrix.os }}-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.toml') }}-
- ${{ matrix.os }}-cargo-${{ github.job }}-
- ${{ matrix.os }}-cargo-
+ ubuntu-latest-cargo-${{ github.job }}-${{ hashFiles('**/Cargo.toml') }}-
+ ubuntu-latest-cargo-${{ github.job }}-
+ ubuntu-latest-cargo-
- - name: Install stable toolchain
- uses: actions-rs/toolchain@v1
+ - name: Cache build target
+ uses: actions/cache@v2.1.4
with:
- toolchain: stable
- override: true
+ path: target
+ # Add date to the cache to keep it up to date
+ key: ubuntu-latest-target-${{ github.job }}-${{ hashFiles('**/Cargo.toml') }}-${{ env.CURRENT_DATE }}
+ # Restore from outdated cache for speed
+ restore-keys: |
+ ubuntu-latest-target-${{ github.job }}-${{ hashFiles('**/Cargo.toml') }}-
+ ubuntu-latest-target-${{ github.job }}-
+ ubuntu-latest-target-
- name: Build
uses: actions-rs/cargo@v1
@@ -48,10 +71,11 @@ jobs:
args: --examples --verbose
- name: Run Rust examples
+ working-directory: examples
run: |
- cd examples
cargo read-manifest | for entry in $(python3 -c "import sys, json; print(' '.join(list(map(lambda x: x['name'], json.load(sys.stdin)['targets']))))"); do cargo run --example "$entry"; done
- build-and-test-examples:
+
+ build-and-test-wasm-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
