2019-09-24 23:22:36 +00:00
|
|
|
name: GitHub CI
|
2019-09-25 17:56:12 +00:00
|
|
|
on: push
|
2019-09-24 23:22:36 +00:00
|
|
|
|
|
|
|
jobs:
|
2019-11-23 19:36:32 +00:00
|
|
|
build-csharp-windows:
|
2019-11-28 01:13:45 +00:00
|
|
|
name: C# (${{ matrix.os }})
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest]
|
2019-10-03 16:04:21 +00:00
|
|
|
|
2019-09-24 23:22:36 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
|
2019-12-31 09:16:25 +00:00
|
|
|
- name: Run generator, verify no diff
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
|
|
|
cd src/csharp/Intel/Generator
|
|
|
|
dotnet run -c Release
|
|
|
|
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
|
|
|
git diff --exit-code
|
|
|
|
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
|
|
|
|
2020-01-26 19:21:08 +00:00
|
|
|
- name: Build one feature at a time
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
|
|
|
foreach ($def in
|
2020-01-27 18:29:31 +00:00
|
|
|
"NO_ENCODER;NO_INSTR_INFO;NO_GAS;NO_INTEL;NO_MASM;NO_NASM",
|
|
|
|
"NO_DECODER;NO_INSTR_INFO;NO_GAS;NO_INTEL;NO_MASM;NO_NASM",
|
|
|
|
"NO_DECODER;NO_ENCODER;NO_GAS;NO_INTEL;NO_MASM;NO_NASM",
|
|
|
|
"NO_DECODER;NO_ENCODER;NO_INSTR_INFO;NO_INTEL;NO_MASM;NO_NASM",
|
|
|
|
"NO_DECODER;NO_ENCODER;NO_INSTR_INFO;NO_GAS;NO_MASM;NO_NASM",
|
|
|
|
"NO_DECODER;NO_ENCODER;NO_INSTR_INFO;NO_GAS;NO_INTEL;NO_NASM",
|
|
|
|
"NO_DECODER;NO_ENCODER;NO_INSTR_INFO;NO_GAS;NO_INTEL;NO_MASM"
|
2020-01-26 19:21:08 +00:00
|
|
|
) {
|
|
|
|
git clean -xdf
|
|
|
|
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
|
|
|
$env:MoreDefineConstants=$def
|
|
|
|
dotnet build -v:m -c Release src/csharp/Intel/Iced/Iced.csproj
|
|
|
|
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
|
|
|
}
|
|
|
|
foreach ($def in
|
2020-01-27 18:29:31 +00:00
|
|
|
"NO_ENCODER;NO_INSTR_INFO;NO_GAS;NO_INTEL;NO_MASM;NO_NASM",
|
|
|
|
"NO_INSTR_INFO;NO_GAS;NO_INTEL;NO_MASM;NO_NASM",
|
|
|
|
"NO_ENCODER;NO_GAS;NO_INTEL;NO_MASM;NO_NASM",
|
|
|
|
"NO_ENCODER;NO_INSTR_INFO;NO_INTEL;NO_MASM;NO_NASM",
|
|
|
|
"NO_ENCODER;NO_INSTR_INFO;NO_GAS;NO_MASM;NO_NASM",
|
|
|
|
"NO_ENCODER;NO_INSTR_INFO;NO_GAS;NO_INTEL;NO_NASM",
|
|
|
|
"NO_ENCODER;NO_INSTR_INFO;NO_GAS;NO_INTEL;NO_MASM"
|
2020-01-26 19:21:08 +00:00
|
|
|
) {
|
|
|
|
git clean -xdf
|
|
|
|
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
|
|
|
$env:MoreDefineConstants=$def
|
|
|
|
dotnet build -v:m -c Release src/csharp/Intel/Iced.UnitTests/Iced.UnitTests.csproj
|
|
|
|
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
|
|
|
}
|
2020-01-26 19:39:38 +00:00
|
|
|
git clean -xdf
|
2020-01-26 19:21:08 +00:00
|
|
|
|
2019-09-24 23:22:36 +00:00
|
|
|
- name: Build, test
|
2019-10-04 16:28:14 +00:00
|
|
|
shell: pwsh
|
2019-09-24 23:22:36 +00:00
|
|
|
run: |
|
2019-10-04 16:28:14 +00:00
|
|
|
.\build.ps1
|
2019-09-24 23:22:36 +00:00
|
|
|
|
|
|
|
- name: upload-artifact doesn't support wildcards
|
2019-10-04 16:28:14 +00:00
|
|
|
shell: pwsh
|
2019-09-24 23:22:36 +00:00
|
|
|
run: |
|
2019-10-04 16:28:14 +00:00
|
|
|
New-Item -ItemType Directory nuget_files > $null
|
2019-11-06 01:49:44 +00:00
|
|
|
Copy-Item src\csharp\Intel\Iced\bin\Release\*.*nupkg nuget_files
|
2019-09-24 23:22:36 +00:00
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: nupkg
|
|
|
|
path: nuget_files
|
2019-09-25 17:56:12 +00:00
|
|
|
|
2019-10-05 15:57:58 +00:00
|
|
|
- uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: coverage.info
|
2019-11-06 01:49:44 +00:00
|
|
|
path: src/csharp/Intel/Iced.UnitTests/coverage.info
|
2019-10-05 15:57:58 +00:00
|
|
|
|
2019-10-05 13:52:24 +00:00
|
|
|
- name: Upload coverage report
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
curl https://codecov.io/bash -o codecov
|
|
|
|
chmod +x codecov
|
2019-11-06 01:49:44 +00:00
|
|
|
./codecov -f src/csharp/Intel/Iced.UnitTests/coverage.info
|
2019-10-05 13:52:24 +00:00
|
|
|
env:
|
|
|
|
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
|
|
|
|
|
2019-09-25 17:56:12 +00:00
|
|
|
- name: Upload to nuget.org if it's a new release
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
shell: pwsh
|
|
|
|
run: |
|
2019-10-03 16:04:21 +00:00
|
|
|
Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -UseBasicParsing -OutFile nuget.exe
|
2019-11-06 01:49:44 +00:00
|
|
|
Get-ChildItem src\csharp\Intel\Iced\bin\Release\Iced.*.nupkg | ForEach-Object { .\nuget.exe push $_.FullName -ApiKey ${{secrets.NUGET_APIKEY}} -NonInteractive -Source https://api.nuget.org/v3/index.json }
|
2019-10-06 18:38:57 +00:00
|
|
|
|
|
|
|
# Make sure it builds on Linux too
|
2019-11-28 01:13:45 +00:00
|
|
|
build-csharp:
|
|
|
|
name: C# (${{ matrix.os }})
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest]
|
2019-10-06 18:38:57 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
|
2020-01-03 21:12:14 +00:00
|
|
|
- uses: actions/setup-dotnet@v1
|
|
|
|
with:
|
|
|
|
dotnet-version: '3.1.100'
|
|
|
|
|
2019-10-06 18:38:57 +00:00
|
|
|
- name: Build, test
|
|
|
|
shell: pwsh
|
2019-10-06 18:52:59 +00:00
|
|
|
run: ./build.ps1
|
2019-11-23 19:36:32 +00:00
|
|
|
|
|
|
|
build-rust:
|
|
|
|
name: Rust (${{ matrix.os }})
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
|
|
|
|
- name: Install rustup and rustc latest (macOS)
|
|
|
|
shell: bash
|
|
|
|
if: startsWith(matrix.os, 'macos-')
|
|
|
|
run: |
|
|
|
|
curl https://sh.rustup.rs -sSf | bash -s -- -y
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
|
|
rustup install stable
|
|
|
|
|
|
|
|
- name: Install rustc
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
2019-12-23 16:04:03 +00:00
|
|
|
# It fails on Windows, disable auto self update
|
|
|
|
rustup toolchain install 1.20.0 --no-self-update
|
2020-01-05 12:11:28 +00:00
|
|
|
rustup toolchain install nightly --no-self-update
|
2019-12-23 16:04:03 +00:00
|
|
|
rustup update --no-self-update
|
2019-11-23 19:36:32 +00:00
|
|
|
|
2020-01-15 19:25:18 +00:00
|
|
|
- name: Build no_std
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
|
|
export RUSTFLAGS="-D warnings"
|
|
|
|
git clean -xdf
|
2020-01-16 06:55:26 +00:00
|
|
|
cd src/rust/iced-x86
|
2020-01-15 19:25:18 +00:00
|
|
|
echo ==== BUILD DEBUG ====
|
2020-01-27 18:29:31 +00:00
|
|
|
cargo build --color always --lib --no-default-features --features "no_std decoder encoder instr_info gas intel masm nasm"
|
2020-01-16 06:55:26 +00:00
|
|
|
cd ../../..
|
2020-01-15 19:25:18 +00:00
|
|
|
git clean -xdf
|
|
|
|
|
2020-01-26 19:21:08 +00:00
|
|
|
- name: Build one feature at a time
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
|
|
export RUSTFLAGS="-D warnings"
|
|
|
|
cd src/rust/iced-x86
|
|
|
|
echo ==== std decoder ====
|
|
|
|
cargo check --lib --no-default-features --features "std decoder"
|
|
|
|
echo ==== std encoder ====
|
|
|
|
cargo check --lib --no-default-features --features "std encoder"
|
|
|
|
echo ==== std instr_info ====
|
|
|
|
cargo check --lib --no-default-features --features "std instr_info"
|
2020-01-27 18:29:31 +00:00
|
|
|
echo ==== std gas ====
|
|
|
|
cargo check --lib --no-default-features --features "std gas"
|
|
|
|
echo ==== std intel ====
|
|
|
|
cargo check --lib --no-default-features --features "std intel"
|
|
|
|
echo ==== std masm ====
|
|
|
|
cargo check --lib --no-default-features --features "std masm"
|
|
|
|
echo ==== std nasm ====
|
|
|
|
cargo check --lib --no-default-features --features "std nasm"
|
2020-01-26 19:21:08 +00:00
|
|
|
|
|
|
|
echo ==== TEST std decoder ====
|
|
|
|
cargo check --tests --lib --no-default-features --features "std decoder"
|
|
|
|
echo ==== TEST std decoder encoder ====
|
|
|
|
cargo check --tests --lib --no-default-features --features "std decoder encoder"
|
|
|
|
echo ==== TEST std decoder instr_info ====
|
|
|
|
cargo check --tests --lib --no-default-features --features "std decoder instr_info"
|
2020-01-27 18:29:31 +00:00
|
|
|
echo ==== TEST std decoder gas ====
|
|
|
|
cargo check --tests --lib --no-default-features --features "std decoder gas"
|
|
|
|
echo ==== TEST std decoder intel ====
|
|
|
|
cargo check --tests --lib --no-default-features --features "std decoder intel"
|
|
|
|
echo ==== TEST std decoder masm ====
|
|
|
|
cargo check --tests --lib --no-default-features --features "std decoder masm"
|
|
|
|
echo ==== TEST std decoder nasm ====
|
|
|
|
cargo check --tests --lib --no-default-features --features "std decoder nasm"
|
2020-01-26 19:21:08 +00:00
|
|
|
cd ..
|
|
|
|
git clean -xdf
|
|
|
|
|
2019-11-23 19:36:32 +00:00
|
|
|
- name: Build, test (default)
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
2019-12-17 20:46:30 +00:00
|
|
|
export RUSTFLAGS="-D warnings"
|
2019-11-23 19:36:32 +00:00
|
|
|
cargo -V
|
2019-11-28 01:13:45 +00:00
|
|
|
cd src/rust/iced-x86
|
2019-11-23 19:36:32 +00:00
|
|
|
echo ==== CLIPPY ====
|
|
|
|
cargo clippy --color always
|
2019-12-03 19:41:35 +00:00
|
|
|
echo ==== CLIPPY --tests ====
|
|
|
|
cargo clippy --color always --tests
|
2019-11-28 01:13:45 +00:00
|
|
|
echo ==== FORMAT CHECK ====
|
2019-11-23 20:19:42 +00:00
|
|
|
cargo fmt -- --color always --check
|
2020-01-05 12:11:28 +00:00
|
|
|
echo ==== DOC ====
|
|
|
|
# Use nightly since that's what docs.rs uses
|
|
|
|
cargo +nightly doc
|
2019-11-23 19:36:32 +00:00
|
|
|
echo ==== BUILD DEBUG ====
|
|
|
|
cargo build --color always
|
|
|
|
echo ==== TEST DEBUG ====
|
|
|
|
cargo test --color always
|
|
|
|
echo ==== BUILD RELEASE ====
|
|
|
|
cargo build --color always --release
|
|
|
|
echo ==== TEST RELEASE ====
|
|
|
|
cargo test --color always --release
|
2020-01-05 12:11:28 +00:00
|
|
|
echo ==== PUBLISH DRY-RUN ====
|
2020-01-05 22:52:52 +00:00
|
|
|
# It fails on Windows without this, claiming that some random number of rust files are dirty.
|
|
|
|
# This is the 2nd GitHub CI for Windows hack I've added to this file.
|
|
|
|
git status
|
|
|
|
git diff
|
2020-01-05 12:11:28 +00:00
|
|
|
cargo publish --color always --dry-run
|
2019-11-23 19:36:32 +00:00
|
|
|
|
|
|
|
- name: Build, test (1.20.0)
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
2019-12-17 20:46:30 +00:00
|
|
|
export RUSTFLAGS="-D warnings"
|
2019-11-23 19:36:32 +00:00
|
|
|
cd src/rust/iced-x86
|
2019-11-30 01:35:28 +00:00
|
|
|
echo ==== UPDATE Cargo.lock ====
|
|
|
|
cargo +1.20.0 generate-lockfile
|
|
|
|
cargo +1.20.0 update --package lazy_static --precise 1.1.0
|
2019-11-23 19:36:32 +00:00
|
|
|
echo ==== BUILD DEBUG ====
|
|
|
|
cargo +1.20.0 build --color always
|
|
|
|
echo ==== TEST DEBUG ====
|
|
|
|
cargo +1.20.0 test --color always
|
|
|
|
echo ==== BUILD RELEASE ====
|
|
|
|
cargo +1.20.0 build --color always --release
|
|
|
|
echo ==== TEST RELEASE ====
|
|
|
|
cargo +1.20.0 test --color always --release
|