@@ -16,12 +16,13 @@ jobs:
1616 strategy :
1717 matrix :
1818 include :
19- - { os: windows-latest, rust-version: stable, shell: 'msys2 {0}' }
20- - { os: macos-11, rust-version: stable, shell: bash }
21- - { os: ubuntu-20.04, rust-version: stable, shell: bash, extra: true }
22- - { os: ubuntu-20.04, rust-version: 1.65, shell: bash }
23- - { os: ubuntu-20.04, rust-version: beta, shell: bash }
24- - { os: ubuntu-20.04, rust-version: nightly, shell: bash }
19+ - { os: windows-latest, rust-version: stable, shell: 'msys2 {0}', target: 'x86_64-pc-windows-gnu'}
20+ - { os: macos-11, rust-version: stable, shell: bash, target: 'x86_64-apple-darwin' }
21+ - { os: ubuntu-20.04, rust-version: stable, shell: bash, extra: true, target: 'x86_64-unknown-linux-gnu' }
22+ - { os: ubuntu-20.04, rust-version: stable, shell: bash, target: 'i686-unknown-linux-gnu' }
23+ - { os: ubuntu-20.04, rust-version: 1.65, shell: bash, target: 'x86_64-unknown-linux-gnu'}
24+ - { os: ubuntu-20.04, rust-version: beta, shell: bash, target: 'x86_64-unknown-linux-gnu'}
25+ - { os: ubuntu-20.04, rust-version: nightly, shell: bash, target: 'x86_64-unknown-linux-gnu'}
2526 defaults :
2627 run :
2728 shell : ${{ matrix.shell }}
3233 id : toolchain
3334 with :
3435 toolchain : ${{ matrix.rust-version }}
36+ targets : ${{ matrix.target }}
3537 components : clippy, rustfmt
38+ - name : Install i686 dependencies
39+ if : " contains(matrix.target,'i686')"
40+ 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
3641 - uses : msys2/setup-msys2@v2
3742 if : contains(matrix.os,'windows')
3843 with :
@@ -48,14 +53,14 @@ jobs:
4853 ~/.cargo/registry/cache/
4954 ~/.cargo/git/db/
5055 target/
51- key : ${{ matrix.os }}_rustc-${{ steps.toolchain.outputs.cachekey }}_cargo-${{ hashFiles('**/Cargo.lock') }}
56+ key : ${{ matrix.os }}_${{ matrix.target }} _rustc-${{ steps.toolchain.outputs.cachekey }}_cargo-${{ hashFiles('**/Cargo.lock') }}
5257
5358 # Build and test.
5459 - name : Build library
55- run : cargo rustc --verbose --lib -- -D warnings
60+ run : cargo rustc --target ${{ matrix.target }} -- verbose --lib -- -D warnings
5661 - name : Test
5762 if : " !matrix.extra"
58- run : cargo test --all --verbose
63+ run : cargo test --target ${{ matrix.target }} -- all --verbose
5964
6065 # Extra steps only run once to avoid duplication, when matrix.extra is true
6166 - name : Test and report
@@ -90,14 +95,14 @@ jobs:
9095 - name : Build release binary
9196 if : contains(matrix.rust-version,'stable')
9297 run : |
93- cargo rustc --verbose --bin scryer-prolog --release -- -D warnings
98+ cargo rustc --target ${{ matrix.target }} -- verbose --bin scryer-prolog --release -- -D warnings
9499 echo "$PWD/target/release" >> $GITHUB_PATH
95100 - name : Publish release binary artifact
96101 if : contains(matrix.rust-version,'stable')
97102 uses : actions/upload-artifact@v3
98103 with :
99- path : target/release/scryer-prolog*
100- name : scryer-prolog_${{ matrix.os }}
104+ path : target/${{ matrix.target }}/ release/scryer-prolog*
105+ name : scryer-prolog_${{ matrix.os }}_${{ matrix.target }}
101106
102107 logtalk-test :
103108 runs-on : ubuntu-20.04
@@ -106,7 +111,7 @@ jobs:
106111 # Download prebuilt ubuntu binary from build-test job, setup logtalk
107112 - uses : actions/download-artifact@v3
108113 with :
109- name : scryer-prolog_ubuntu-20.04
114+ name : scryer-prolog_ubuntu-20.04_x86_64-unknown-linux-gnu
110115 - run : |
111116 chmod +x scryer-prolog
112117 echo "$PWD" >> "$GITHUB_PATH"
@@ -154,9 +159,9 @@ jobs:
154159 - uses : actions/download-artifact@v3
155160 - name : Zip binaries for release
156161 run : |
157- zip scryer-prolog_macos-11.zip ./scryer-prolog_macos-11 /scryer-prolog
158- zip scryer-prolog_ubuntu-20.04.zip ./scryer-prolog_ubuntu-20.04 /scryer-prolog
159- zip scryer-prolog_windows-latest.zip ./scryer-prolog_windows-latest /scryer-prolog.exe
162+ zip scryer-prolog_macos-11.zip ./scryer-prolog_macos-11_x86_64-apple-darwin /scryer-prolog
163+ zip scryer-prolog_ubuntu-20.04.zip ./scryer-prolog_ubuntu-20.04_x86_64-unknown-linux-gnu /scryer-prolog
164+ zip scryer-prolog_windows-latest.zip ./scryer-prolog_windows-latest_x86_64-pc-windows-gnu /scryer-prolog.exe
160165 - name : Release
161166 uses : softprops/action-gh-release@v1
162167 with :
0 commit comments