Add support for MUSL x86_64 and fix CI scripts (#145)

next
Sayan Nandan 3 years ago committed by GitHub
parent d18631680c
commit 3699cc4720
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,16 +20,15 @@ jobs:
matrix:
build: [linux, macos, windows]
include:
- build: linux
os: ubuntu-latest
- os: ubuntu-latest
artifact: x86_64-linux-gnu
- build: macos
os: macos-latest
rust: x86_64-unknown-linux-gnu
- os: macos-latest
artifact: x86_64-macos
- build: windows
os: windows-latest
rust: x86_64-apple-darwin
- os: windows-latest
artifact: x86_64-windows
rust: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v2
@ -37,25 +36,25 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ matrix.build }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
key: ${{ matrix.rust }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.build }}-cargo-registry-
${{ matrix.rust }}-cargo-registry-
- name: Cache Cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ matrix.build }}-cargo-index-${{ hashFiles('Cargo.lock') }}
key: ${{ matrix.rust }}-cargo-index-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.build }}-cargo-index-
${{ matrix.rust }}-cargo-index-
- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ matrix.build }}-target-${{ hashFiles('Cargo.lock') }}
key: ${{ matrix.rust }}-target-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.build }}-target-
${{ matrix.rust }}-target-
- name: Query version number
id: get_version
@ -66,17 +65,17 @@ jobs:
- name: Install Rust
run: |
rustup update ${{ matrix.rust }} --no-self-update
rustup default ${{ matrix.rust }}
rustup default stable
rustup target add ${{ matrix.rust }}
- name: Build
if: runner.os != 'Windows'
run: cargo build --release
run: cargo build --release --target ${{ matrix.rust }}
- name: Build (Windows)
shell: cmd # Use cmd as the default shell to avoid perl path errors
if: runner.os == 'Windows'
run: cargo build --release
run: cargo build --release --target ${{ matrix.rust }}
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
@ -85,9 +84,9 @@ jobs:
with:
name: ${{ matrix.artifact }}
path: |
target/release/skyd
target/release/skysh
target/release/sky-bench
target/${{ matrix.rust }}/release/skyd
target/${{ matrix.rust }}/release/skysh
target/${{ matrix.rust }}/release/sky-bench
if: runner.os != 'Windows'
- name: Upload binaries (Windows)
@ -95,9 +94,9 @@ jobs:
with:
name: ${{ matrix.artifact }}
path: |
target/release/skyd.exe
target/release/skysh.exe
target/release/sky-bench.exe
target/${{ matrix.rust }}/release/skyd.exe
target/${{ matrix.rust }}/release/skysh.exe
target/${{ matrix.rust }}/release/sky-bench.exe
if: runner.os == 'Windows'
build_32bit:
name: Build artifacts (32-bit)
@ -158,14 +157,14 @@ jobs:
run: |
rustup target add ${{ matrix.rust }}
- name: Build
- name: Build
if: runner.os != 'Windows'
run: cargo build --release
run: cargo build --release --target ${{ matrix.rust }}
- name: Build (Windows)
shell: cmd # Use cmd as the default shell to avoid perl path errors
if: runner.os == 'Windows'
run: cargo build --release
run: cargo build --release --target ${{ matrix.rust }}
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
@ -174,9 +173,9 @@ jobs:
with:
name: ${{ matrix.artifact }}
path: |
target/release/skyd
target/release/skysh
target/release/sky-bench
target/${{ matrix.rust }}/release/skyd
target/${{ matrix.rust }}/release/skysh
target/${{ matrix.rust }}/release/sky-bench
if: runner.os != 'Windows'
- name: Upload binaries (Windows)
@ -184,16 +183,82 @@ jobs:
with:
name: ${{ matrix.artifact }}
path: |
target/release/skyd.exe
target/release/skysh.exe
target/release/sky-bench.exe
target/${{ matrix.rust }}/release/skyd.exe
target/${{ matrix.rust }}/release/skysh.exe
target/${{ matrix.rust }}/release/sky-bench.exe
if: runner.os == 'Windows'
build_musl:
name: Build Linux x86_64-musl (Tier 2)
runs-on: ${{ matrix.os }}
strategy:
matrix:
build: [linux]
include:
- build: linux
os: ubuntu-latest
artifact: x86_64-linux-musl
rust: x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v2
- 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: Query version number
id: get_version
shell: bash
run: |
echo "using version tag ${GITHUB_REF:10}"
echo ::set-output name=version::"${GITHUB_REF:10}"
- name: Install MUSL tools
run: |
sudo apt update && sudo apt install musl-tools -y
- name: Install Rust
run: |
rustup target add ${{ matrix.rust }}
- name: Build
run: cargo build --release --target ${{ matrix.rust }}
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact }}
path: |
target/${{ matrix.rust }}/release/skyd
target/${{ matrix.rust }}/release/skysh
target/${{ matrix.rust }}/release/sky-bench
release:
name: Release Tier 1
name: Release
needs:
- build_64bit
- build_32bit
- build_musl
runs-on: ubuntu-latest
steps:
- name: Query version number
@ -217,7 +282,7 @@ jobs:
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Archive artifacts
run: |
wget https://raw.githubusercontent.com/skytable/skytable/next/ci/artifact.sh
@ -273,3 +338,12 @@ jobs:
asset_path: artifacts/i686-windows.zip
asset_content_type: application/octet-stream
asset_name: sky-bundle-${{ steps.get_version.outputs.VERSION }}-i686-windows.zip
- name: Release Linux bundle (x86_64 MUSL)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.TDBB }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/x86_64-linux-musl.zip
asset_content_type: application/octet-stream
asset_name: sky-bundle-${{ steps.get_version.outputs.VERSION }}-x86_64-linux-musl.zip

@ -17,7 +17,8 @@ jobs:
- test_64bit
- test_32bit
steps:
- run: exit 0
- name: Finish Tier 1 Tests
run: exit 0
test_64bit:
name: Test (64-bit)
runs-on: ${{ matrix.os }}
@ -109,17 +110,17 @@ jobs:
- name: Archive artifacts
run: |
mkdir dist
cargo build
mv target/debug/skyd target/debug/skysh target/debug/sky-bench 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: env.IS_MD_FILE == 'false' && runner.os != 'Windows'
- name: Archive artifacts
shell: cmd
run: |
cargo build
cargo build --target ${{ matrix.rust }}
rm -rf dist
mkdir dist
move target\debug\*.exe dist
move target\${{ matrix.rust }}\debug\*.exe dist
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
if: env.IS_MD_FILE == 'false' && runner.os == 'Windows'
@ -206,17 +207,17 @@ jobs:
- name: Archive artifacts
run: |
mkdir dist
cargo build
mv target/debug/skyd target/debug/skysh target/debug/sky-bench 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: env.IS_MD_FILE == 'false' && runner.os == 'Linux'
- name: Archive artifacts
shell: cmd
run: |
cargo build
cargo build --target ${{ matrix.rust }}
rm -rf dist
mkdir dist
move target\debug\*.exe dist
move target\${{ matrix.rust }}\debug\*.exe dist
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
if: env.IS_MD_FILE == 'false' && runner.os == 'Windows'
@ -227,3 +228,79 @@ jobs:
name: ${{ github.sha }}-${{ matrix.rust }}-builds.zip
path: dist
if: env.IS_MD_FILE == 'false'
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-
if: env.IS_MD_FILE == 'false'
- 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-
if: env.IS_MD_FILE == 'false'
- name: Cache Cargo build
uses: actions/cache@v2
with:
path: target
key: ${{ matrix.rust }}-target-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.rust }}-target-
if: env.IS_MD_FILE == 'false'
- name: Install MUSL tools
run: sudo apt-get update && sudo apt-get install musl-tools -y
if: runner.os == 'Linux'
- name: Install Rust
run: |
rustup default stable
rustup target add ${{ matrix.rust }}
if: env.IS_MD_FILE == 'false'
- name: Run Tests
run: cargo test --verbose --target ${{ matrix.rust }}
env:
RUST_BACKTRACE: 1
if: env.IS_MD_FILE == 'false' && runner.os == 'Linux'
- 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: env.IS_MD_FILE == 'false'
- name: Save artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ github.sha }}-${{ matrix.rust }}-builds.zip
path: dist
if: env.IS_MD_FILE == 'false'

Loading…
Cancel
Save