iced/.github/workflows/build.yml

159 lines
4.2 KiB
YAML
Raw Normal View History

2019-09-24 23:22:36 +00:00
name: GitHub CI
2020-07-10 15:20:31 +00:00
on:
push:
paths:
- ".github/workflows/build.yml"
- "src/**"
- "!**/*.md"
2020-08-27 21:58:46 +00:00
branches:
- master
pull_request:
paths:
- "src/**"
- "!**/*.md"
2020-07-10 15:20:31 +00:00
branches:
- master
2020-07-19 11:03:51 +00:00
release:
types: [released]
env:
2020-11-10 23:04:50 +00:00
CI_REQ_DOTNET_SDK_VER: 5.0.100
CI_NODE_MIN_VER: 10.0.0
RUSTFLAGS: -D warnings
2019-09-24 23:22:36 +00:00
jobs:
2019-11-23 19:36:32 +00:00
build-csharp-windows:
name: C# (${{matrix.os}})
runs-on: ${{matrix.os}}
2019-11-28 01:13:45 +00:00
strategy:
matrix:
os: [windows-latest]
2019-10-03 16:04:21 +00:00
2019-09-24 23:22:36 +00:00
steps:
2020-10-26 18:49:09 +00:00
- uses: actions/checkout@v2
2019-09-24 23:22:36 +00:00
- uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{env.CI_REQ_DOTNET_SDK_VER}}
2020-01-26 19:21:08 +00:00
2019-09-24 23:22:36 +00:00
- name: Build, test
shell: bash
2020-11-07 12:25:29 +00:00
run: ./build/build-dotnet
2019-09-24 23:22:36 +00:00
- name: upload-artifact doesn't support wildcards
2020-07-10 15:20:31 +00:00
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
shell: bash
2019-09-24 23:22:36 +00:00
run: |
mkdir nuget_files
cp src/csharp/Intel/Iced/bin/Release/*.*nupkg nuget_files/
2019-09-24 23:22:36 +00:00
2020-10-26 18:49:09 +00:00
- uses: actions/upload-artifact@v2
2020-07-10 15:20:31 +00:00
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
2019-09-24 23:22:36 +00:00
with:
name: nupkg
path: nuget_files
2020-10-26 18:49:09 +00:00
if-no-files-found: error
2019-09-25 17:56:12 +00:00
2020-10-26 18:49:09 +00:00
- uses: actions/upload-artifact@v2
2020-07-10 15:20:31 +00:00
if: github.ref == 'refs/heads/master'
2019-10-05 15:57:58 +00:00
with:
name: coverage.info
2020-11-10 23:04:50 +00:00
path: src/csharp/Intel/Iced.UnitTests/coverage.net5.0.info
2020-10-26 18:49:09 +00:00
if-no-files-found: error
2019-10-05 15:57:58 +00:00
2019-10-05 13:52:24 +00:00
- name: Upload coverage report
2020-07-10 15:20:31 +00:00
if: github.ref == 'refs/heads/master'
2019-10-05 13:52:24 +00:00
shell: bash
2020-07-10 15:20:31 +00:00
continue-on-error: true
2019-10-05 13:52:24 +00:00
run: |
curl https://codecov.io/bash -o codecov
chmod +x codecov
2020-11-10 23:04:50 +00:00
./codecov -f src/csharp/Intel/Iced.UnitTests/coverage.net5.0.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: bash
2019-09-25 17:56:12 +00:00
run: |
curl https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -o nuget.exe
for file in src/csharp/Intel/Iced/bin/Release/Iced.*.nupkg; do
./nuget.exe push "$file" -ApiKey "${{secrets.NUGET_APIKEY}}" -NonInteractive -Source https://api.nuget.org/v3/index.json
done
2019-10-06 18:38:57 +00:00
# Make sure it builds on Linux/macOS too
2019-11-28 01:13:45 +00:00
build-csharp:
name: C# (${{matrix.os}})
runs-on: ${{matrix.os}}
2019-11-28 01:13:45 +00:00
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
2019-10-06 18:38:57 +00:00
steps:
2020-10-26 18:49:09 +00:00
- uses: actions/checkout@v2
2019-10-06 18:38:57 +00:00
2020-01-03 21:12:14 +00:00
- uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{env.CI_REQ_DOTNET_SDK_VER}}
2020-01-03 21:12:14 +00:00
2019-10-06 18:38:57 +00:00
- name: Build, test
shell: bash
2020-11-07 12:25:29 +00:00
run: ./build/build-dotnet --quick-check
2019-11-23 19:36:32 +00:00
build-rust:
name: Rust (${{matrix.os}})
runs-on: ${{matrix.os}}
2019-11-23 19:36:32 +00:00
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
2020-10-26 18:49:09 +00:00
- uses: actions/checkout@v2
2019-11-23 19:36:32 +00:00
- name: Update PATH env
shell: bash
run: |
echo "$HOME/.cargo/bin" >> "$GITHUB_PATH"
2019-11-23 19:36:32 +00:00
- name: Install rustup and rustc latest (macOS)
shell: bash
if: startsWith(matrix.os, 'macos-')
run: |
curl https://sh.rustup.rs -sSf | bash -s -- -y
rustup install stable
rustup component add rustfmt
rustup component add clippy
2019-11-23 19:36:32 +00:00
- name: Install rustc
shell: bash
run: |
# It fails on Windows so disable auto self update
2019-12-23 16:04:03 +00:00
rustup toolchain install 1.20.0 --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-04-13 21:44:26 +00:00
- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: ${{env.CI_NODE_MIN_VER}}
2020-04-13 21:44:26 +00:00
- name: Install wasm-pack
shell: bash
run: npm install -g wasm-pack
2020-04-13 21:44:26 +00:00
2020-08-02 19:25:39 +00:00
- uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{env.CI_REQ_DOTNET_SDK_VER}}
2020-08-02 19:25:39 +00:00
- name: Build and test (Rust)
2020-01-15 19:25:18 +00:00
shell: bash
run: |
2020-11-07 12:25:29 +00:00
./build/build-rust --no-set-rustflags
2020-01-26 19:21:08 +00:00
git clean -xdf
- name: Build and test (JS)
2020-04-13 21:13:47 +00:00
shell: bash
run: |
2020-11-07 12:25:29 +00:00
./build/build-js --no-set-rustflags
2020-04-13 21:13:47 +00:00
git clean -xdf