Update dependencies #149
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: Compile | |
on: | |
push: | |
branches: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
compile: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- run: cargo build | |
encode-decode: | |
needs: compile | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Setup Cluster | |
run: | | |
ln -sfT "$(mktemp -d)" tmpdir | |
mkdir -p tmpdir/{metadata/tmpdir,repo} | |
dd if=/dev/urandom of=tmpdir/TESTFILE bs=256K count=201 | |
- name: Encode File | |
run: cargo run -- cp tmpdir/TESTFILE examples/test.yaml#tmpdir/TESTFILE | |
- name: Decode File | |
run: | | |
cargo run -- cp @#tmpdir/metadata/tmpdir/TESTFILE tmpdir/TESTFILE.repair | |
- name: Verify Integrity | |
run: | | |
ORIG="$(sha256sum tmpdir/TESTFILE | sed 's/ .*//')" | |
REP="$(sha256sum tmpdir/TESTFILE.repair | sed 's/ .*//')" | |
echo "$ORIG ?= $REP" | |
[ "$ORIG" == "$REP" ] | |
validate-example-clusters: | |
needs: compile | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Validate Examples | |
run: | | |
FAILED=0 | |
for file in examples/*.yaml ; do | |
echo "$file" | |
if ! cargo run -- cluster-info "$file" ; then | |
FAILED="$((FAILED+1))" | |
fi | |
done | |
((FAILED==0)) | |
run-cargo-tests: | |
needs: compile | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Run Tests | |
run: cargo test |