-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Ubuntu 18.04 containers fail since Node16 removal in GitHub-hoste…
…d runners (#27)
- Loading branch information
Showing
4 changed files
with
156 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 25 additions & 14 deletions
39
.github/workflows/ubuntu-18.04-docker-minimal-custom-image.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,38 @@ | ||
name: Ubuntu 18.04 (Docker Minimal Custom Image) | ||
on: [push, pull_request] | ||
env: | ||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | ||
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/ | ||
CONTAINER: dalboris/test-cpp-github-actions-docker-ubuntu-18.04-minimal | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: dalboris/test-cpp-github-actions-docker-ubuntu-18.04-minimal | ||
steps: | ||
|
||
- uses: actions/checkout@v3 # Cannot use v4 (requires Node20/GLIBC_2.28 not available on Ubuntu 18.04) | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Dependencies | ||
# We manually start a container and execute scripts in it instead of using `jobs.build.container`, | ||
# otherwise we couldn't use GitHub-provided actions (checkout, cache, etc.) as they rely on Node20 | ||
# which would not necessarily be available on some containers (e.g., Ubuntu 18.04). | ||
# | ||
# See: https://github.com/actions/checkout/issues/1590 | ||
# | ||
- name: Start Docker Container | ||
run: | | ||
apt-get update | ||
apt-get install -y libharfbuzz-dev | ||
docker pull $CONTAINER | ||
docker run --name build-container -d -v ${{ github.workspace }}:/workspace $CONTAINER tail -f /dev/null | ||
- name: Install Dependencies | ||
env: | ||
SCRIPT: | | ||
apt-get update | ||
apt-get install -y libharfbuzz-dev | ||
run: docker exec build-container bash -c "$SCRIPT" | ||
|
||
- name: Build | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake --version | ||
cmake .. -DCMAKE_BUILD_TYPE=Release | ||
cmake --build . | ||
env: | ||
SCRIPT: | | ||
cd /workspace && mkdir build && cd build | ||
cmake --version | ||
cmake .. -DCMAKE_BUILD_TYPE=Release | ||
cmake --build . | ||
run: docker exec build-container bash -c "$SCRIPT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,38 @@ | ||
name: Ubuntu 18.04 (Docker Minimal) | ||
on: [push, pull_request] | ||
env: | ||
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true | ||
# https://github.blog/changelog/2024-03-07-github-actions-all-actions-will-run-on-node20-instead-of-node16-by-default/ | ||
CONTAINER: ubuntu:18.04 | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: ubuntu:18.04 | ||
steps: | ||
|
||
- uses: actions/checkout@v3 # Cannot use v4 (requires Node20/GLIBC_2.28 not available on Ubuntu 18.04) | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Dependencies | ||
# We manually start a container and execute scripts in it instead of using `jobs.build.container`, | ||
# otherwise we couldn't use GitHub-provided actions (checkout, cache, etc.) as they rely on Node20 | ||
# which would not necessarily be available on some containers (e.g., Ubuntu 18.04). | ||
# | ||
# See: https://github.com/actions/checkout/issues/1590 | ||
# | ||
- name: Start Docker Container | ||
run: | | ||
apt-get update | ||
apt-get install -y cmake build-essential libfreetype6-dev libharfbuzz-dev | ||
docker pull $CONTAINER | ||
docker run --name build-container -d -v ${{ github.workspace }}:/workspace $CONTAINER tail -f /dev/null | ||
- name: Install Dependencies | ||
env: | ||
SCRIPT: | | ||
apt-get update | ||
apt-get install -y cmake build-essential libfreetype6-dev libharfbuzz-dev | ||
run: docker exec build-container bash -c "$SCRIPT" | ||
|
||
- name: Build | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
mkdir build | ||
cd build | ||
cmake --version | ||
cmake .. -DCMAKE_BUILD_TYPE=Release | ||
cmake --build . | ||
env: | ||
SCRIPT: | | ||
cd /workspace && mkdir build && cd build | ||
cmake --version | ||
cmake .. -DCMAKE_BUILD_TYPE=Release | ||
cmake --build . | ||
run: docker exec build-container bash -c "$SCRIPT" |
Oops, something went wrong.