name: Test (push) on: push: branches: - "!v*" - "**" env: IS_ACTIONS_DOC: "false" jobs: tests-pass: name: Tier 1 Tests runs-on: ubuntu-latest needs: - test_64bit - test_32bit - test-arm64 steps: - name: Download ARM64 artifact run: wget http://releases.skytable.io/everycommit/${{ github.sha }}-aarch64-unknown-linux-gnu-builds.zip - name: Upload ARM64 artifact uses: actions/upload-artifact@v2 with: name: ${{ github.sha }}-aarch64-unknown-linux-gnu-builds.zip path: ${{ github.sha }}-aarch64-unknown-linux-gnu-builds.zip - name: Finish Tier 1 Tests run: exit 0 test_64bit: name: Test (64-bit) runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] include: - os: ubuntu-latest rust: x86_64-unknown-linux-gnu - os: macos-latest rust: x86_64-apple-darwin - os: windows-latest rust: x86_64-pc-windows-msvc steps: - name: Checkout source code uses: actions/checkout@v2 with: fetch-depth: 2 - name: Install GNU tar run: | brew install gnu-tar echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH if: runner.os == 'macOS' - name: Setup environment run: | chmod +x ci/setvars.sh ci/setvars.sh - name: Cache Cargo registry uses: actions/cache@v2 with: path: ~/.cargo/registry key: ${{ matrix.rust }}-cargo-registry-${{ hashFiles('Cargo.lock') }} restore-keys: | ${{ matrix.rust }}-cargo-registry- - name: Cache Cargo index uses: actions/cache@v2 with: path: ~/.cargo/git key: ${{ matrix.rust }}-cargo-index-${{ hashFiles('Cargo.lock') }} restore-keys: | ${{ matrix.rust }}-cargo-index- - name: Cache Cargo build uses: actions/cache@v2 with: path: target key: ${{ matrix.rust }}-target-${{ hashFiles('Cargo.lock') }} restore-keys: | ${{ matrix.rust }}-target- - name: Install Rust run: | rustup default stable rustup target add ${{ matrix.rust }} - name: Publish docs env: BOT_USER: ${{ secrets.BOT_INIT_USER }} BOT_MAIL: ${{ secrets.BOT_INIT_MAIL }} BOT_API: ${{ secrets.BOT_API_CALL }} GIT_SHA: ${{ env.GITHUB_SHA }} run: | chmod +x ci/doc.sh ci/doc.sh if: runner.os == 'Linux' && env.IS_ACTIONS_DOC == 'true' - name: Run Tests run: make test env: RUST_BACKTRACE: 1 TARGET: ${{ matrix.rust }} - name: Archive artifacts run: | mkdir dist cargo build --target ${{ matrix.rust }} mv target/${{ matrix.rust }}/debug/skyd target/${{ matrix.rust }}/debug/skysh target/${{ matrix.rust }}/debug/sky-bench dist if: runner.os != 'Windows' - name: Archive artifacts shell: cmd run: | cargo build --target ${{ matrix.rust }} rm -rf dist mkdir dist move target\${{ matrix.rust }}\debug\*.exe dist env: RUSTFLAGS: -Ctarget-feature=+crt-static if: runner.os == 'Windows' - name: Save artifacts uses: actions/upload-artifact@v2 with: name: ${{ github.sha }}-${{ matrix.rust }}-builds.zip path: dist test_32bit: name: Test (32-bit) runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest] include: - os: ubuntu-latest rust: i686-unknown-linux-gnu - os: windows-latest rust: i686-pc-windows-msvc steps: - name: Checkout source code uses: actions/checkout@v2 with: fetch-depth: 2 - name: Setup environment run: | chmod +x ci/setvars.sh ci/setvars.sh - name: Cache Cargo registry uses: actions/cache@v2 with: path: ~/.cargo/registry key: ${{ matrix.rust }}-cargo-registry-${{ hashFiles('Cargo.lock') }} restore-keys: | ${{ matrix.rust }}-cargo-registry- - name: Cache Cargo index uses: actions/cache@v2 with: path: ~/.cargo/git key: ${{ matrix.rust }}-cargo-index-${{ hashFiles('Cargo.lock') }} restore-keys: | ${{ matrix.rust }}-cargo-index- - name: Cache Cargo build uses: actions/cache@v2 with: path: target key: ${{ matrix.rust }}-target-${{ hashFiles('Cargo.lock') }} restore-keys: | ${{ matrix.rust }}-target- - name: Install Rust run: | rustup default stable rustup target add ${{ matrix.rust }} - name: Run Tests run: make test env: RUST_BACKTRACE: 1 TARGET: ${{ matrix.rust }} - name: Archive artifacts run: | mkdir dist cargo build --target ${{ matrix.rust }} mv target/${{ matrix.rust }}/debug/skyd target/${{ matrix.rust }}/debug/skysh target/${{ matrix.rust }}/debug/sky-bench dist if: runner.os == 'Linux' - name: Archive artifacts shell: cmd run: | cargo build --target ${{ matrix.rust }} rm -rf dist mkdir dist move target\${{ matrix.rust }}\debug\*.exe dist env: RUSTFLAGS: -Ctarget-feature=+crt-static if: runner.os == 'Windows' - name: Save artifacts uses: actions/upload-artifact@v2 with: name: ${{ github.sha }}-${{ matrix.rust }}-builds.zip path: dist test_musl64: name: Test MUSL x86_64 (Tier 2) runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest] include: - os: ubuntu-latest rust: x86_64-unknown-linux-musl steps: - name: Checkout source code uses: actions/checkout@v2 with: fetch-depth: 2 - name: Setup environment run: | chmod +x ci/setvars.sh ci/setvars.sh - name: Cache Cargo registry uses: actions/cache@v2 with: path: ~/.cargo/registry key: ${{ matrix.rust }}-cargo-registry-${{ hashFiles('Cargo.lock') }} restore-keys: | ${{ matrix.rust }}-cargo-registry- - name: Cache Cargo index uses: actions/cache@v2 with: path: ~/.cargo/git key: ${{ matrix.rust }}-cargo-index-${{ hashFiles('Cargo.lock') }} restore-keys: | ${{ matrix.rust }}-cargo-index- - name: Cache Cargo build uses: actions/cache@v2 with: path: target key: ${{ matrix.rust }}-target-${{ hashFiles('Cargo.lock') }} restore-keys: | ${{ matrix.rust }}-target- - name: Install Rust run: | rustup default stable rustup target add ${{ matrix.rust }} - name: Run Tests run: make test env: RUST_BACKTRACE: 1 TARGET: ${{ matrix.rust }} - name: Archive artifacts run: | mkdir dist cargo build --target ${{ matrix.rust }} mv target/${{ matrix.rust }}/debug/skyd target/${{ matrix.rust }}/debug/skysh target/${{ matrix.rust }}/debug/sky-bench dist - name: Save artifacts uses: actions/upload-artifact@v2 with: name: ${{ github.sha }}-${{ matrix.rust }}-builds.zip path: dist test-arm64: name: Test (self-hosted-arm64-native) runs-on: self-hosted steps: - name: Checkout sources uses: actions/checkout@v2 with: fetch-depth: 2 - name: Set up tools run: | sudo apt update && sudo apt install awscli zip zstd -y aws configure set aws_access_key_id ${{ secrets.STORAGE_ACCESS_KEY }} aws configure set aws_secret_access_key ${{ secrets.STORAGE_ACCESS_SECRET }} aws configure set default.s3.signature_version s3v4 - name: Get cache run: | aws --endpoint-url ${{ secrets.STORAGE_ACCESS_URL }} s3 cp --no-progress s3://cache/skytable-linux-arm64.tar.zst target.tar.zst tar -I zstd -xf target.tar.zst rm target.tar.zst echo "LASTHASH=$(cat target/LASTHASH 2>/dev/null)" >> $GITHUB_ENV continue-on-error: true - name: Install Rust run: | curl https://sh.rustup.rs -sSf | sh -s -- -y echo $HOME/.cargo/bin >> $GITHUB_PATH - name: Test run: make test env: TARGET: aarch64-unknown-linux-gnu - name: Stress test run: make stress if: "contains(toJSON(github.event.commits.*.msg), '[stress-ci]')" - name: Save cache env: NEWHASH: ${{ hashFiles('Cargo.lock') }} LASTHASH: ${{ env.LASTHASH }} run: | if [[ ${NEWHASH} != ${LASTHASH} ]]; then echo "Freshening cache" tar --zstd -cf target.tar.zst target aws --endpoint-url ${{ secrets.STORAGE_ACCESS_URL }} s3 cp --no-progress target.tar.zst s3://cache/skytable-linux-arm64.tar.zst echo "Finished freshening cache" else echo "Cache hit occurred. Not saving cache" fi - name: Save artifacts run: | cargo build -j16 --target aarch64-unknown-linux-gnu zip -j dist.zip target/aarch64-unknown-linux-gnu/debug/skyd target/aarch64-unknown-linux-gnu/debug/skysh target/aarch64-unknown-linux-gnu/debug/sky-bench aws --endpoint-url ${{ secrets.STORAGE_ACCESS_URL }} s3 cp dist.zip s3://everycommit/${{ github.sha }}-aarch64-unknown-linux-gnu-builds.zip