@@ -16,12 +16,13 @@ jobs:
16
16
strategy :
17
17
matrix :
18
18
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'}
25
26
defaults :
26
27
run :
27
28
shell : ${{ matrix.shell }}
32
33
id : toolchain
33
34
with :
34
35
toolchain : ${{ matrix.rust-version }}
36
+ targets : ${{ matrix.target }}
35
37
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
36
41
- uses : msys2/setup-msys2@v2
37
42
if : contains(matrix.os,'windows')
38
43
with :
@@ -48,14 +53,14 @@ jobs:
48
53
~/.cargo/registry/cache/
49
54
~/.cargo/git/db/
50
55
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') }}
52
57
53
58
# Build and test.
54
59
- name : Build library
55
- run : cargo rustc --verbose --lib -- -D warnings
60
+ run : cargo rustc --target ${{ matrix.target }} -- verbose --lib -- -D warnings
56
61
- name : Test
57
62
if : " !matrix.extra"
58
- run : cargo test --all --verbose
63
+ run : cargo test --target ${{ matrix.target }} -- all --verbose
59
64
60
65
# Extra steps only run once to avoid duplication, when matrix.extra is true
61
66
- name : Test and report
@@ -90,14 +95,14 @@ jobs:
90
95
- name : Build release binary
91
96
if : contains(matrix.rust-version,'stable')
92
97
run : |
93
- cargo rustc --verbose --bin scryer-prolog --release -- -D warnings
98
+ cargo rustc --target ${{ matrix.target }} -- verbose --bin scryer-prolog --release -- -D warnings
94
99
echo "$PWD/target/release" >> $GITHUB_PATH
95
100
- name : Publish release binary artifact
96
101
if : contains(matrix.rust-version,'stable')
97
102
uses : actions/upload-artifact@v3
98
103
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 }}
101
106
102
107
logtalk-test :
103
108
runs-on : ubuntu-20.04
@@ -106,7 +111,7 @@ jobs:
106
111
# Download prebuilt ubuntu binary from build-test job, setup logtalk
107
112
- uses : actions/download-artifact@v3
108
113
with :
109
- name : scryer-prolog_ubuntu-20.04
114
+ name : scryer-prolog_ubuntu-20.04_x86_64-unknown-linux-gnu
110
115
- run : |
111
116
chmod +x scryer-prolog
112
117
echo "$PWD" >> "$GITHUB_PATH"
@@ -154,9 +159,9 @@ jobs:
154
159
- uses : actions/download-artifact@v3
155
160
- name : Zip binaries for release
156
161
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
160
165
- name : Release
161
166
uses : softprops/action-gh-release@v1
162
167
with :
0 commit comments