Skip to content

Commit ec7f381

Browse files
authored
fix: use ubuntu-20.04 container (#2118)
1 parent 3add276 commit ec7f381

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ jobs:
3434
- target: Linux
3535
# Build using older Linux version to preserve sdk compatibility with old GLIBC
3636
# See discussion in https://github.com/getsentry/sentry-unity/issues/1730 for more details
37-
host: ubuntu-20.04
37+
container: ubuntu:20.04
38+
host: ubuntu-latest
3839
- target: Windows
3940
host: windows-latest
4041
uses: ./.github/workflows/sdk.yml
4142
with:
4243
target: ${{ matrix.target }}
4344
runsOn: ${{ matrix.host }}
45+
container: ${{ matrix.container }}
4446

4547
build-unity-sdk:
4648
name: Build Unity SDK

.github/workflows/sdk.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
target:
88
required: true
99
type: string
10+
container:
11+
required: false
12+
type: string
13+
default: ''
1014

1115
env:
1216
DOTNET_CLI_TELEMETRY_OPTOUT: 1
@@ -15,8 +19,26 @@ env:
1519
jobs:
1620
build:
1721
runs-on: ${{ inputs.runsOn }}
22+
container: ${{ inputs.container }}
1823
timeout-minutes: 30
1924
steps:
25+
- name: Set up Git in container
26+
if: ${{ inputs.container != '' }}
27+
# ubuntu:20.04 does not have git installed by default. Make it available
28+
# for actions/checkout to get a proper clone instead of downloading a
29+
# tarball using the GitHub REST API. This ensures that git submodule
30+
# commands work as expected.
31+
#
32+
# Furthermore, add an exception for the workspace directory to avoid the
33+
# following git error (runner host vs. container):
34+
# fatal: detected dubious ownership in repository at '/__w/sentry-unity/sentry-unity'
35+
run: |
36+
apt-get update
37+
apt-get install -y git
38+
git config --global --add safe.directory $GITHUB_WORKSPACE
39+
env:
40+
DEBIAN_FRONTEND: noninteractive
41+
2042
- uses: actions/checkout@v3
2143

2244
- name: Select submodules
@@ -52,8 +74,12 @@ jobs:
5274
- name: Installing Linux Dependencies
5375
if: ${{ inputs.target == 'Linux' && steps.cache.outputs.cache-hit != 'true' }}
5476
run: |
55-
sudo apt-get update
56-
sudo apt-get install zlib1g-dev libcurl4-openssl-dev libssl-dev
77+
apt-get update
78+
apt-get install -y zlib1g-dev libcurl4-openssl-dev libssl-dev build-essential cmake curl
79+
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 9.0 --install-dir /usr/share/dotnet
80+
echo "/usr/share/dotnet" >> $GITHUB_PATH
81+
env:
82+
DEBIAN_FRONTEND: noninteractive
5783

5884
- name: Build
5985
if: steps.cache.outputs.cache-hit != 'true'

0 commit comments

Comments
 (0)