Skip to content

Commit

Permalink
Merge pull request #1978 from aarroyoc/ci-32-bits
Browse files Browse the repository at this point in the history
32 bit CI for Linux
  • Loading branch information
mthom committed Aug 28, 2023
2 parents 3bfed50 + 4523bb5 commit 61b34bf
Show file tree
Hide file tree
Showing 4 changed files with 209 additions and 270 deletions.
37 changes: 21 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ jobs:
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 }}
Expand All @@ -32,7 +33,11 @@ jobs:
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:
Expand All @@ -48,14 +53,14 @@ jobs:
~/.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
Expand Down Expand Up @@ -90,14 +95,14 @@ jobs:
- 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
Expand All @@ -106,7 +111,7 @@ jobs:
# 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"
Expand Down Expand Up @@ -154,9 +159,9 @@ jobs:
- 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:
Expand Down
Loading

0 comments on commit 61b34bf

Please sign in to comment.