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-02-10 19:03:58 +00:00
|
|
|
"DECODER",
|
|
|
|
"ENCODER",
|
2020-03-28 19:09:27 +00:00
|
|
|
"ENCODER;BLOCK_ENCODER",
|
|
|
|
"ENCODER;OPCODE_INFO",
|
2020-02-10 19:03:58 +00:00
|
|
|
"INSTR_INFO",
|
|
|
|
"GAS",
|
|
|
|
"INTEL",
|
|
|
|
"MASM",
|
|
|
|
"NASM"
|
2020-01-26 19:21:08 +00:00
|
|
|
) {
|
|
|
|
git clean -xdf
|
|
|
|
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
2020-02-10 19:03:58 +00:00
|
|
|
$env:IcedFeatureFlags=$def
|
2020-01-26 19:21:08 +00:00
|
|
|
dotnet build -v:m -c Release src/csharp/Intel/Iced/Iced.csproj
|
|
|
|
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
|
|
|
}
|
|
|
|
foreach ($def in
|
2020-02-10 19:03:58 +00:00
|
|
|
"DECODER",
|
|
|
|
"DECODER;ENCODER",
|
2020-03-28 19:02:12 +00:00
|
|
|
"DECODER;ENCODER;BLOCK_ENCODER",
|
2020-03-28 19:02:29 +00:00
|
|
|
"DECODER;ENCODER;OPCODE_INFO",
|
2020-02-10 19:03:58 +00:00
|
|
|
"DECODER;INSTR_INFO",
|
|
|
|
"DECODER;GAS",
|
|
|
|
"DECODER;INTEL",
|
|
|
|
"DECODER;MASM",
|
|
|
|
"DECODER;NASM"
|
2020-01-26 19:21:08 +00:00
|
|
|
) {
|
|
|
|
git clean -xdf
|
|
|
|
if ($LASTEXITCODE) { exit $LASTEXITCODE }
|
2020-02-10 19:03:58 +00:00
|
|
|
$env:IcedFeatureFlags=$def
|
2020-01-26 19:21:08 +00:00
|
|
|
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
|
2020-03-21 18:36:38 +00:00
|
|
|
rustup target add wasm32-unknown-unknown
|
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-04-02 17:35:38 +00:00
|
|
|
|
2020-01-15 19:25:18 +00:00
|
|
|
echo ==== BUILD DEBUG ====
|
2020-03-28 19:02:29 +00:00
|
|
|
cargo check --color always --no-default-features --features "no_std decoder encoder block_encoder op_code_info instr_info gas intel masm nasm db"
|
2020-04-02 17:35:38 +00:00
|
|
|
|
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
|
|
|
|
|
2020-04-02 17:35:38 +00:00
|
|
|
allFeatures=(
|
|
|
|
"std decoder"
|
|
|
|
"std encoder"
|
|
|
|
"std encoder block_encoder"
|
|
|
|
"std encoder op_code_info"
|
|
|
|
"std instr_info"
|
|
|
|
"std gas"
|
|
|
|
"std intel"
|
|
|
|
"std masm"
|
|
|
|
"std nasm"
|
|
|
|
)
|
|
|
|
for features in "${allFeatures[@]}"; do
|
|
|
|
echo ==== $features ====
|
|
|
|
cargo check --color always --no-default-features --features "$features"
|
|
|
|
done
|
2020-02-01 15:33:31 +00:00
|
|
|
|
2020-04-02 17:35:38 +00:00
|
|
|
allFeatures=(
|
|
|
|
"no_std decoder"
|
|
|
|
"no_std encoder"
|
|
|
|
"no_std encoder block_encoder"
|
|
|
|
"no_std encoder op_code_info"
|
|
|
|
"no_std instr_info"
|
|
|
|
"no_std gas"
|
|
|
|
"no_std intel"
|
|
|
|
"no_std masm"
|
|
|
|
"no_std nasm"
|
|
|
|
)
|
|
|
|
for features in "${allFeatures[@]}"; do
|
|
|
|
echo ==== $features ====
|
|
|
|
cargo check --color always --no-default-features --features "$features"
|
|
|
|
done
|
|
|
|
|
|
|
|
allFeatures=(
|
|
|
|
"std decoder"
|
|
|
|
"std decoder encoder"
|
|
|
|
"std decoder encoder block_encoder"
|
|
|
|
"std decoder encoder op_code_info"
|
|
|
|
"std decoder instr_info"
|
|
|
|
"std decoder gas"
|
|
|
|
"std decoder intel"
|
|
|
|
"std decoder masm"
|
|
|
|
"std decoder nasm"
|
|
|
|
)
|
|
|
|
for features in "${allFeatures[@]}"; do
|
|
|
|
echo ==== TEST $features ====
|
|
|
|
cargo check --color always --tests --no-default-features --features "$features"
|
|
|
|
done
|
2020-03-25 18:19:55 +00:00
|
|
|
|
2020-03-26 17:07:20 +00:00
|
|
|
cd ..
|
|
|
|
git clean -xdf
|
|
|
|
|
|
|
|
- name: iced-x86-js
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
|
|
export RUSTFLAGS="-D warnings"
|
|
|
|
cd src/rust/iced-x86-js
|
|
|
|
|
2020-04-01 22:28:49 +00:00
|
|
|
echo ==== FORMAT CHECK ====
|
|
|
|
cargo fmt -- --color always --check
|
2020-04-12 19:23:16 +00:00
|
|
|
echo ==== CLIPPY instr_api decoder encoder block_encoder instr_create op_code_info instr_info gas intel masm nasm ====
|
|
|
|
cargo clippy --color always --target wasm32-unknown-unknown --no-default-features --features "instr_api decoder encoder block_encoder instr_create op_code_info instr_info gas intel masm nasm"
|
|
|
|
echo ==== CLIPPY instr_api decoder encoder block_encoder instr_create op_code_info instr_info gas intel masm nasm bigint ====
|
|
|
|
cargo clippy --color always --target wasm32-unknown-unknown --no-default-features --features "instr_api decoder encoder block_encoder instr_create op_code_info instr_info gas intel masm nasm bigint"
|
2020-03-25 18:19:55 +00:00
|
|
|
|
2020-04-02 17:35:38 +00:00
|
|
|
allFeatures=(
|
|
|
|
"decoder"
|
2020-04-12 19:23:16 +00:00
|
|
|
"instr_api decoder"
|
2020-04-02 17:35:38 +00:00
|
|
|
"encoder"
|
2020-04-12 19:23:16 +00:00
|
|
|
"instr_api encoder"
|
2020-04-02 17:35:38 +00:00
|
|
|
"encoder block_encoder"
|
2020-04-12 19:23:10 +00:00
|
|
|
"instr_create"
|
|
|
|
"encoder instr_create"
|
2020-04-02 17:35:38 +00:00
|
|
|
"encoder op_code_info"
|
2020-04-12 19:23:16 +00:00
|
|
|
"instr_api encoder op_code_info"
|
2020-04-02 17:35:38 +00:00
|
|
|
"instr_info"
|
2020-04-12 19:23:16 +00:00
|
|
|
"instr_api instr_info"
|
2020-04-02 17:35:38 +00:00
|
|
|
"gas"
|
|
|
|
"intel"
|
|
|
|
"masm"
|
|
|
|
"nasm"
|
2020-04-12 19:23:16 +00:00
|
|
|
"instr_api nasm"
|
2020-04-02 17:35:38 +00:00
|
|
|
)
|
|
|
|
for features in "${allFeatures[@]}"; do
|
|
|
|
echo ==== $features ====
|
|
|
|
cargo check --color always --target wasm32-unknown-unknown --no-default-features --features "$features"
|
|
|
|
done
|
|
|
|
|
2020-01-26 19:21:08 +00:00
|
|
|
cd ..
|
|
|
|
git clean -xdf
|
|
|
|
|
2020-04-13 21:13:47 +00:00
|
|
|
- name: Install Node.js
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 10.0.0
|
|
|
|
|
|
|
|
- name: iced-x86-js
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
export PATH="$HOME/.cargo/bin:$PATH"
|
|
|
|
export RUSTFLAGS="-D warnings"
|
|
|
|
|
|
|
|
cd src/rust/iced-x86-js
|
|
|
|
wasm-pack build --mode force --target nodejs
|
|
|
|
cd src/tests
|
|
|
|
npm install
|
|
|
|
npm run test
|
|
|
|
|
|
|
|
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
|
2020-02-01 16:08:08 +00:00
|
|
|
cargo +nightly doc --color always
|
2019-11-23 19:36:32 +00:00
|
|
|
echo ==== BUILD DEBUG ====
|
2020-02-11 16:38:44 +00:00
|
|
|
cargo build --color always --features "db"
|
2019-11-23 19:36:32 +00:00
|
|
|
echo ==== TEST DEBUG ====
|
2020-02-11 16:38:44 +00:00
|
|
|
cargo test --color always --features "db"
|
2019-11-23 19:36:32 +00:00
|
|
|
echo ==== BUILD RELEASE ====
|
2020-02-11 16:38:44 +00:00
|
|
|
cargo build --color always --features "db" --release
|
2019-11-23 19:36:32 +00:00
|
|
|
echo ==== TEST RELEASE ====
|
2020-02-11 16:38:44 +00:00
|
|
|
cargo test --color always --features "db" --release
|
2020-03-21 18:36:38 +00:00
|
|
|
echo ==== BUILD RELEASE wasm32-unknown-unknown ====
|
|
|
|
cargo check --color always --features "db" --target wasm32-unknown-unknown --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
|
2020-02-10 21:03:21 +00:00
|
|
|
cargo +1.20.0 update --package lazy_static --precise 1.1.1
|
2019-11-23 19:36:32 +00:00
|
|
|
echo ==== BUILD DEBUG ====
|
2020-02-11 16:38:44 +00:00
|
|
|
cargo +1.20.0 build --color always --features "db"
|
2019-11-23 19:36:32 +00:00
|
|
|
echo ==== TEST DEBUG ====
|
2020-02-11 16:38:44 +00:00
|
|
|
cargo +1.20.0 test --color always --features "db" -- --skip "lib.rs"
|
2019-11-23 19:36:32 +00:00
|
|
|
echo ==== BUILD RELEASE ====
|
2020-02-11 16:38:44 +00:00
|
|
|
cargo +1.20.0 build --color always --features "db" --release
|
2019-11-23 19:36:32 +00:00
|
|
|
echo ==== TEST RELEASE ====
|
2020-02-11 16:38:44 +00:00
|
|
|
cargo +1.20.0 test --color always --features "db" --release -- --skip "lib.rs"
|