strategy:
matrix:
include:
- - { os: windows-latest, rust-version: stable, shell: 'msys2 {0}' }
- - { os: macos-11, rust-version: stable, shell: bash }
- - { os: ubuntu-20.04, rust-version: stable, shell: bash, extra: true }
- - { os: ubuntu-20.04, rust-version: 1.65, shell: bash }
- - { os: ubuntu-20.04, rust-version: beta, shell: bash }
- - { os: ubuntu-20.04, rust-version: nightly, shell: bash }
+ - { os: windows-latest, rust-version: stable, shell: 'msys2 {0}', target: 'x86_64-pc-windows-gnu'}
+ - { os: macos-11, rust-version: stable, shell: bash, target: 'x86_64-apple-darwin' }
+ - { os: ubuntu-20.04, rust-version: stable, shell: bash, extra: true, target: 'x86_64-unknown-linux-gnu' }
+ - { os: ubuntu-20.04, rust-version: stable, shell: bash, target: 'i686-unknown-linux-gnu' }
+ - { os: ubuntu-20.04, rust-version: 1.65, shell: bash, target: 'x86_64-unknown-linux-gnu'}
+ - { os: ubuntu-20.04, rust-version: beta, shell: bash, target: 'x86_64-unknown-linux-gnu'}
+ - { os: ubuntu-20.04, rust-version: nightly, shell: bash, target: 'x86_64-unknown-linux-gnu'}
defaults:
run:
shell: ${{ matrix.shell }}
id: toolchain
with:
toolchain: ${{ matrix.rust-version }}
+ targets: ${{ matrix.target }}
components: clippy, rustfmt
+ - name: Install i686 dependencies
+ if: "contains(matrix.target,'i686')"
+ run: sudo dpkg --add-architecture i386 && sudo apt-get update && sudo apt-get install libssl-dev:i386 gcc-multilib clang -y && echo "CC=clang" >> $GITHUB_ENV && echo "PKG_CONFIG_SYSROOT_DIR=/" >> $GITHUB_ENV
- uses: msys2/setup-msys2@v2
if: contains(matrix.os,'windows')
with:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
- key: ${{ matrix.os }}_rustc-${{ steps.toolchain.outputs.cachekey }}_cargo-${{ hashFiles('**/Cargo.lock') }}
+ key: ${{ matrix.os }}_${{ matrix.target }}_rustc-${{ steps.toolchain.outputs.cachekey }}_cargo-${{ hashFiles('**/Cargo.lock') }}
# Build and test.
- name: Build library
- run: cargo rustc --verbose --lib -- -D warnings
+ run: cargo rustc --target ${{ matrix.target }} --verbose --lib -- -D warnings
- name: Test
if: "!matrix.extra"
- run: cargo test --all --verbose
+ run: cargo test --target ${{ matrix.target }} --all --verbose
# Extra steps only run once to avoid duplication, when matrix.extra is true
- name: Test and report
- name: Build release binary
if: contains(matrix.rust-version,'stable')
run: |
- cargo rustc --verbose --bin scryer-prolog --release -- -D warnings
+ cargo rustc --target ${{ matrix.target }} --verbose --bin scryer-prolog --release -- -D warnings
echo "$PWD/target/release" >> $GITHUB_PATH
- name: Publish release binary artifact
if: contains(matrix.rust-version,'stable')
uses: actions/upload-artifact@v3
with:
- path: target/release/scryer-prolog*
- name: scryer-prolog_${{ matrix.os }}
+ path: target/${{ matrix.target }}/release/scryer-prolog*
+ name: scryer-prolog_${{ matrix.os }}_${{ matrix.target }}
logtalk-test:
runs-on: ubuntu-20.04
# Download prebuilt ubuntu binary from build-test job, setup logtalk
- uses: actions/download-artifact@v3
with:
- name: scryer-prolog_ubuntu-20.04
+ name: scryer-prolog_ubuntu-20.04_x86_64-unknown-linux-gnu
- run: |
chmod +x scryer-prolog
echo "$PWD" >> "$GITHUB_PATH"
- uses: actions/download-artifact@v3
- name: Zip binaries for release
run: |
- zip scryer-prolog_macos-11.zip ./scryer-prolog_macos-11/scryer-prolog
- zip scryer-prolog_ubuntu-20.04.zip ./scryer-prolog_ubuntu-20.04/scryer-prolog
- zip scryer-prolog_windows-latest.zip ./scryer-prolog_windows-latest/scryer-prolog.exe
+ zip scryer-prolog_macos-11.zip ./scryer-prolog_macos-11_x86_64-apple-darwin/scryer-prolog
+ zip scryer-prolog_ubuntu-20.04.zip ./scryer-prolog_ubuntu-20.04_x86_64-unknown-linux-gnu/scryer-prolog
+ zip scryer-prolog_windows-latest.zip ./scryer-prolog_windows-latest_x86_64-pc-windows-gnu/scryer-prolog.exe
- name: Release
uses: softprops/action-gh-release@v1
with: