iced/.github/workflows/build.yml

127 lines
3.7 KiB
YAML
Raw Normal View History

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
- 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
- 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"
rustup toolchain install 1.20.0
rustup update
- name: Build, test (default)
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
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-11-28 01:13:45 +00:00
echo ==== FORMAT CHECK ====
2019-11-23 20:19:42 +00:00
cargo fmt -- --color always --check
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
- name: Build, test (1.20.0)
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
cd src/rust/iced-x86
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