You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

303 lines
9.0 KiB
YAML

name: Test (push)
on:
push:
branches:
- "!v*"
- "**"
env:
CARGO_TERM_COLOR: always
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:
4 years ago
- name: Checkout source code
uses: actions/checkout@v2
with:
4 years ago
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: Install perl modules
uses: perl-actions/install-with-cpanm@v1
with:
install: "HTML::Entities"
- 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 != '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: Install perl modules
uses: perl-actions/install-with-cpanm@v1
with:
install: "HTML::Entities"
- 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: Install perl modules
uses: perl-actions/install-with-cpanm@v1
with:
install: "HTML::Entities"
- 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 perl libhtml-parser-perl -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: 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 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