Skip to content

Commit

Permalink
chore: add ubuntu 22.04 to CI (#2596)
Browse files Browse the repository at this point in the history
We got reports of problems on Ubuntu 22.04. Because of this, we're adding it to CI

As discussed, this does the following:
- Add 22.04 to Publish workflow
- Add 22.04 to Smoke tests
- port build steps from Publish to e2e build
  • Loading branch information
sesi200 committed Sep 26, 2022
1 parent 7ae3117 commit a21e11b
Showing 1 changed file with 72 additions and 13 deletions.
85 changes: 72 additions & 13 deletions .github/workflows/e2e.yml
Expand Up @@ -15,13 +15,28 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-11, ubuntu-20.04]
rust: ["1.60.0"]
binary_path: ["target/release"]
rust: [ '1.60.0' ]
# We build a dynamic-linked linux binary because otherwise HSM support fails with:
# Error: IO: Dynamic loading not supported
os: [ macos-11, ubuntu-20.04, ubuntu-22.04 ]
include:
- os: macos-11
target: x86_64-apple-darwin
binary_path: target/x86_64-apple-darwin/release
- os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
binary_path: target/x86_64-unknown-linux-gnu/release
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
binary_path: target/x86_64-unknown-linux-gnu/release
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup environment variables
run: |
echo "OPENSSL_STATIC=yes" >> $GITHUB_ENV
echo "RUSTFLAGS=--remap-path-prefix=${GITHUB_WORKSPACE}=/builds/dfinity" >> $GITHUB_ENV
- name: Cache Cargo
uses: actions/cache@v2
with:
Expand All @@ -30,17 +45,61 @@ jobs:
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-${{ matrix.rust }}-1
- name: Install Rust
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
if: contains(matrix.os, 'macos')
- name: Build static-linked openssl
run: |
rustup update ${{ matrix.rust }} --no-self-update
rustup default ${{ matrix.rust }}
rustup component add rustfmt
# https://github.com/rust-lang/cargo/issues/713#issuecomment-59597433
git clone git://git.openssl.org/openssl.git
cd openssl
./config -fPIC --prefix=/usr/local --openssldir=/usr/local/ssl
make
sudo make install
echo "OPENSSL_LIB_DIR=/usr/local/lib64" >> $GITHUB_ENV
echo "OPENSSL_INCLUDE_DIR=/usr/local/include" >> $GITHUB_ENV
if: contains(matrix.target, 'linux-gnu')
- name: Build
# note: since there is no 'cargo clean' here, the results of scripts/prepare-dfx-assets.sh
# are often cached.
run: cargo build --locked --release
env:
OPENSSL_STATIC: yes
run: |
cargo clean --target ${{ matrix.target }} --release
cargo build --target ${{ matrix.target }} --locked --release
- name: Check dynamically-linked libraries (macos)
run: |
ACTUAL="$(otool -L ${{ matrix.binary_path }}/dfx | awk 'NR > 1{ print $1 }' | grep -v /System/Library/Frameworks | sort | awk -v d=" " '{s=(NR==1?s:s d)$0}END{printf "%s",s}')"
EXPECTED="/usr/lib/libSystem.B.dylib /usr/lib/libiconv.2.dylib /usr/lib/libresolv.9.dylib"
echo "Dynamically-linked libraries:"
echo " Actual: $ACTUAL"
echo " Expected: $EXPECTED"
if [ "$ACTUAL" != "$EXPECTED" ]; then
exit 1
fi
if: contains(matrix.os, 'macos')
- name: Check dynamically-linked libraries (ubuntu 20.04)
run: |
ACTUAL="$(ldd ${{ matrix.binary_path }}/dfx | awk '{ print $1 }' | sort | awk -v d=" " '{s=(NR==1?s:s d)$0}END{printf "%s",s}')"
EXPECTED="/lib64/ld-linux-x86-64.so.2 libc.so.6 libdl.so.2 libgcc_s.so.1 libm.so.6 libpthread.so.0 linux-vdso.so.1"
echo "Dynamically-linked libraries:"
echo " Actual: $ACTUAL"
echo " Expected: $EXPECTED"
if [ "$ACTUAL" != "$EXPECTED" ]; then
exit 1
fi
if: ${{ matrix.os == 'ubuntu-20.04' }}
- name: Check dynamically-linked libraries (ubuntu 22.04)
run: |
ACTUAL="$(ldd ${{ matrix.binary_path }}/dfx | awk '{ print $1 }' | sort | awk -v d=" " '{s=(NR==1?s:s d)$0}END{printf "%s",s}')"
EXPECTED="/lib64/ld-linux-x86-64.so.2 libc.so.6 libgcc_s.so.1 libm.so.6 linux-vdso.so.1"
echo "Dynamically-linked libraries:"
echo " Actual: $ACTUAL"
echo " Expected: $EXPECTED"
if [ "$ACTUAL" != "$EXPECTED" ]; then
exit 1
fi
if: ${{ matrix.os == 'ubuntu-22.04' }}
- name: Strip binaries
run: |
cd ${{ matrix.binary_path }}
Expand Down Expand Up @@ -73,7 +132,7 @@ jobs:
# ubuntu-18.04 not supported due to:
# /home/runner/.cache/dfinity/versions/0.8.3-34-g36e39809/ic-starter:
# /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found
os: [macos-11, ubuntu-20.04]
os: [macos-11, ubuntu-20.04, ubuntu-22.04]
rust: ["1.60.0"]
steps:
- uses: actions/checkout@v3
Expand Down

0 comments on commit a21e11b

Please sign in to comment.