mirror of https://github.com/icedland/iced.git
197 lines
6.0 KiB
YAML
197 lines
6.0 KiB
YAML
name: GitHub CI
|
|
on:
|
|
push:
|
|
paths:
|
|
- ".github/workflows/build.yml"
|
|
- "build/**"
|
|
- "src/**"
|
|
- "!**/*.md"
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
paths:
|
|
- ".github/workflows/build.yml"
|
|
- "build/**"
|
|
- "src/**"
|
|
- "!**/*.md"
|
|
branches:
|
|
- master
|
|
|
|
# Keep this in sync with the other *.yml files
|
|
env:
|
|
CI_REQ_DOTNET_SDK_VER: '6.0.x'
|
|
CI_NODE_MIN_VER: '14.0.0'
|
|
RUSTFLAGS: '-D warnings'
|
|
MACOSX_DEPLOYMENT_TARGET: '10.12'
|
|
|
|
jobs:
|
|
|
|
#############################################################################
|
|
#############################################################################
|
|
#############################################################################
|
|
|
|
build-dotnet:
|
|
name: C# (${{matrix.os}})
|
|
runs-on: ${{matrix.os}}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
|
|
- uses: actions/setup-dotnet@v2
|
|
with:
|
|
dotnet-version: ${{env.CI_REQ_DOTNET_SDK_VER}}
|
|
|
|
- name: Build and test
|
|
shell: bash
|
|
run: ./build/build-dotnet --quick-check
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: nupkg
|
|
path: src/csharp/Intel/Iced/bin/Release/*.*nupkg
|
|
if-no-files-found: error
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: coverage.info
|
|
path: src/csharp/Intel/Iced.UnitTests/coverage.info
|
|
if-no-files-found: error
|
|
|
|
- name: Upload coverage report
|
|
if: github.ref == 'refs/heads/master'
|
|
shell: bash
|
|
continue-on-error: true
|
|
run: |
|
|
# https://docs.codecov.com/docs/codecov-uploader
|
|
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
|
|
curl -Os https://uploader.codecov.io/latest/linux/codecov
|
|
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
|
|
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
|
|
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
|
|
shasum -a 256 -c codecov.SHA256SUM
|
|
chmod +x codecov
|
|
./codecov -t "${{secrets.CODECOV_TOKEN}}" -f "src/csharp/Intel/Iced.UnitTests/coverage.info"
|
|
|
|
#############################################################################
|
|
#############################################################################
|
|
#############################################################################
|
|
|
|
build-rust:
|
|
name: Rust (${{matrix.os}})
|
|
runs-on: ${{matrix.os}}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
|
|
- name: Install Rust
|
|
shell: bash
|
|
run: bash build/ci-install-rust.sh
|
|
|
|
- uses: actions/setup-dotnet@v2
|
|
with:
|
|
dotnet-version: ${{env.CI_REQ_DOTNET_SDK_VER}}
|
|
|
|
- name: Install kcov
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install kcov
|
|
|
|
- name: Build and test
|
|
shell: bash
|
|
run: ./build/build-rust --no-set-rustflags --no-tests --test-current --test-msrv --test-no_std --coverage
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: rust-coverage
|
|
path: cov-out/rust/merged/
|
|
if-no-files-found: error
|
|
|
|
- name: Upload coverage report
|
|
if: github.ref == 'refs/heads/master'
|
|
shell: bash
|
|
continue-on-error: true
|
|
run: |
|
|
# https://docs.codecov.com/docs/codecov-uploader
|
|
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
|
|
curl -Os https://uploader.codecov.io/latest/linux/codecov
|
|
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
|
|
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
|
|
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
|
|
shasum -a 256 -c codecov.SHA256SUM
|
|
chmod +x codecov
|
|
./codecov -t "${{secrets.CODECOV_TOKEN}}" -f "cov-out/rust/merged/kcov-merged/cobertura.xml"
|
|
|
|
#############################################################################
|
|
#############################################################################
|
|
#############################################################################
|
|
|
|
build-rust-js-wasm:
|
|
name: JavaScript (${{matrix.os}})
|
|
runs-on: ${{matrix.os}}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
|
|
- name: Install Rust
|
|
shell: bash
|
|
run: bash build/ci-install-rust.sh
|
|
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{env.CI_NODE_MIN_VER}}
|
|
|
|
- name: Install wasm-pack
|
|
shell: bash
|
|
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
|
|
- name: Build and test
|
|
shell: bash
|
|
run: ./build/build-js --no-set-rustflags --quick-check
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
name: npm
|
|
path: src/rust/iced-x86-js/pkg/release/iced-x86-*.tgz
|
|
if-no-files-found: error
|
|
|
|
#############################################################################
|
|
#############################################################################
|
|
#############################################################################
|
|
|
|
build-rust-python-linux-x64:
|
|
name: Python (${{matrix.os}}) x64
|
|
runs-on: ${{matrix.os}}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2.4.0
|
|
|
|
- name: Install Rust
|
|
shell: bash
|
|
run: bash build/ci-install-rust.sh
|
|
|
|
- uses: actions/setup-python@v3
|
|
with:
|
|
python-version: '3.7'
|
|
- name: Install Python tools
|
|
shell: bash
|
|
run: |
|
|
python --version 2>&1 | grep 'Python 3\.7'
|
|
python -m pip install -r src/rust/iced-x86-py/requirements-dev.txt
|
|
|
|
- name: Build and test
|
|
shell: bash
|
|
run: ./build/build-python --no-set-rustflags --python python
|