Skip to content

Commit

Permalink
.github/workflows: Use Ubuntu 22 ;
Browse files Browse the repository at this point in the history
  • Loading branch information
prenaux committed Aug 17, 2023
1 parent 45dd943 commit c7899ca
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ham-test-thrift-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# This workflow contains a single job called "build"
build-ham-test-thrift-deploy:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

# Add "id-token" with the intended permissions.
permissions:
Expand Down
25 changes: 14 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,21 @@ on:
workflow_dispatch:

jobs:
build_ubuntu20:
build_ubuntu:
# The type of runner that the job will run on
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
# Check-out our repository
- uses: actions/checkout@v3

- name: Install Ubuntu packages
- name: Install OS packages
run: |
sudo apt update
DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC sudo apt install -y clang curl ffmpeg freeglut3-dev g++ gcc git libcurl4-openssl-dev lftp libsdl2-dev libssl-dev libudev-dev mesa-common-dev mesa-utils ntpdate p7zip-full pkg-config python3 python3-pip subversion wget xsltproc libdw-dev libunwind-dev
./bin/ham-install-os-packages
- name: ham-toolset repos default
- name: ham-toolset repos svn default
run: |
./bin/ham-toolset repos default
./bin/ham-toolset repos svn default
- name: ham-toolset rclone python_3 nodejs php_8
run: |
Expand All @@ -47,9 +46,13 @@ jobs:
# Check-out our repository
- uses: actions/checkout@v3

- name: ham-toolset repos default
- name: Install OS packages
run: |
./bin/ham-toolset repos default
./bin/ham-install-os-packages
- name: ham-toolset repos svn default
run: |
./bin/ham-toolset repos svn default
- name: ham-toolset rclone python_3 nodejs php_8
run: |
Expand All @@ -76,9 +79,9 @@ jobs:
run: |
.\bin\ham-install-for-windows.cmd
- name: ham-toolset repos default
- name: ham-toolset repos svn default
run: |
.\bin\ham-toolset.cmd repos default
.\bin\ham-toolset.cmd repos svn default
- name: ham-toolset rclone python_3 nodejs php_8
run: |
Expand Down
4 changes: 4 additions & 0 deletions bin/ham-install-os-packages
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash
if [[ -z "$HAM_HOME" ]]; then
export HAM_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
echo "W/HAM_HOME not set, set to:" $HAM_HOME
fi
. "$HAM_HOME/bin/ham-bash-setenv.sh"

# IMPORTANT: Update the tag date when you make any change to the list of
Expand Down
60 changes: 60 additions & 0 deletions bin/lin-x64/lin-apt-install-nodeps
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash -e
function usage() {
echo "usage:"
echo " lin-apt-install-nodeps <package_name> (package_url)"
echo "example:"
echo " lin-apt-install-nodeps git-svn"
exit 1
}

function install_nodeps() {
set -ex

OUTDIR="$TEMPDIR/apt-install-nodeps/$1"
if [[ -e "$OUTDIR" ]]; then
sudo rm -Rf "$OUTDIR"
fi
mkdir -p "$OUTDIR"
cd "$OUTDIR"

PACKAGE_NAME=$1
if [[ -z "$PACKAGE_NAME" ]]; then
usage
fi
URL=$2
DEB_FILE="${PACKAGE_NAME}-dl.deb"
EXTRACT_DIR="${PACKAGE_NAME}-deb"
MODIFIED_DEB="${PACKAGE_NAME}-nodeps.deb"

# Download the .deb package
VERSION=$(sudo apt-cache policy git-svn | grep Candidate | awk '{print $2}')
# Print the URI for that specific version
if [[ -z "$URL" ]]; then
URL=$(apt-get download --print-uris git-svn=$VERSION 2>&1 | grep "^'" | cut -d"'" -f2)
fi
wget $URL -O "$DEB_FILE"

# Check if the download succeeded
if [ $? -ne 0 ]; then
echo "Error downloading package."
return 1
fi

# Extract the .deb package
dpkg-deb -R "$DEB_FILE" "$EXTRACT_DIR"

# Modify the control file to remove the dependency
# sed -i "s/^Depends:.*${DEPENDENCY}/Depends: none/" "$EXTRACT_DIR/DEBIAN/control"
sed -i "/^Depends:.*${DEPENDENCY}/d" "$EXTRACT_DIR/DEBIAN/control"

# Repack the .deb package
dpkg-deb -b "$EXTRACT_DIR" "$MODIFIED_DEB"

# Install the modified .deb package ignoring dependencies
sudo dpkg --force-depends -i "$MODIFIED_DEB"

# Cleanup
# sudo rm -Rf "$OUTDIR"
}

install_nodeps "$@"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:22.04

# Install sudo dependencies. We deploy a single exe so we install the minimum
# dependencies instead of the full ham environment.
Expand Down
10 changes: 9 additions & 1 deletion specs/toolsets/svn/setup-toolset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ case $HAM_OS in
sudo apt install -y subversion
fi
if [[ ! -e "$(git --exec-path)/git-svn" ]]; then
sudo apt install -y git-svn
# This is GITHUB_ACTION workaround because they seem to have
# bypassed regular install to coerce a more recent git version which
# result in the git-svn dependency check failing.
# 1) We install the actual dependencies
sudo apt install -y git libsvn-perl libyaml-perl libterm-readkey-perl
# 2) Install git-svn without checking any dependencies AND we have
# to force the dl URL because even that is custom in the github
# action
lin-apt-install-nodeps git-svn "http://archive.ubuntu.com/ubuntu/pool/universe/g/git/git-svn_2.34.1-1ubuntu1.10_all.deb"
fi
;;
*)
Expand Down

0 comments on commit c7899ca

Please sign in to comment.