iced/.github/workflows/build.yml

127 lines
3.7 KiB
YAML

name: GitHub CI
on: push
jobs:
build-csharp-windows:
name: C# (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest]
steps:
- uses: actions/checkout@v1
- name: Build, test
shell: pwsh
run: |
.\build.ps1
- name: upload-artifact doesn't support wildcards
shell: pwsh
run: |
New-Item -ItemType Directory nuget_files > $null
Copy-Item src\csharp\Intel\Iced\bin\Release\*.*nupkg nuget_files
- uses: actions/upload-artifact@v1
with:
name: nupkg
path: nuget_files
- uses: actions/upload-artifact@v1
with:
name: coverage.info
path: src/csharp/Intel/Iced.UnitTests/coverage.info
- name: Upload coverage report
shell: bash
run: |
curl https://codecov.io/bash -o codecov
chmod +x codecov
./codecov -f src/csharp/Intel/Iced.UnitTests/coverage.info
env:
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
- name: Upload to nuget.org if it's a new release
if: startsWith(github.ref, 'refs/tags/')
shell: pwsh
run: |
Invoke-WebRequest -Uri https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -UseBasicParsing -OutFile nuget.exe
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 }
# Make sure it builds on Linux too
build-csharp:
name: C# (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Build, test
shell: pwsh
run: ./build.ps1
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
cd src/rust/iced-x86
echo ==== CLIPPY ====
cargo clippy --color always
echo ==== FORMAT CHECK ====
cargo fmt -- --color always --check
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
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