|
1 | | -FROM google/dart:2.7 |
2 | | - |
3 | | -# Expose env vars for git ssh access |
4 | | -ARG GIT_SSH_KEY |
5 | | -ARG KNOWN_HOSTS_CONTENT |
6 | | -# Install SSH keys for git ssh access |
7 | | -RUN mkdir /root/.ssh |
8 | | -RUN echo "$KNOWN_HOSTS_CONTENT" > "/root/.ssh/known_hosts" |
9 | | -RUN echo "$GIT_SSH_KEY" > "/root/.ssh/id_rsa" |
10 | | -RUN chmod 700 /root/.ssh/ |
11 | | -RUN chmod 600 /root/.ssh/id_rsa |
12 | | -RUN echo "Setting up ssh-agent for git-based dependencies" |
13 | | -RUN eval "$(ssh-agent -s)" && \ |
14 | | - ssh-add /root/.ssh/id_rsa |
| 1 | +FROM drydock-prod.workiva.net/workiva/dart_build_image:1 |
15 | 2 |
|
16 | | -WORKDIR /build/ |
17 | | -ADD pubspec.yaml /build |
18 | | -RUN pub get |
| 3 | +# Chrome install taken from https://github.com/Workiva/dart_unit_test_image/blob/master@%7B13-01-2021%7D/Dockerfile |
| 4 | + |
| 5 | +# Set the expected Chrome major version. This allows us to update the expected version when |
| 6 | +# we need to roll out a new version of this base image with a new chrome version as the only change |
| 7 | +ENV EXPECTED_CHROME_VERSION=87 |
| 8 | + |
| 9 | +# Install Chrome |
| 10 | +RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ |
| 11 | + echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list && \ |
| 12 | + apt-get -qq update && apt-get install -y google-chrome-stable && \ |
| 13 | + mv /usr/bin/google-chrome-stable /usr/bin/google-chrome && \ |
| 14 | + sed -i --follow-symlinks -e 's/\"\$HERE\/chrome\"/\"\$HERE\/chrome\" --no-sandbox/g' /usr/bin/google-chrome |
19 | 15 |
|
20 | | -# TODO: Remove this and instead run it within the github actions CI on the stable channel once we are able to update the lower bound. |
| 16 | +# Fail the build if the version doesn't match what we expected |
| 17 | +RUN google-chrome --version | grep " $EXPECTED_CHROME_VERSION\." |
| 18 | + |
| 19 | +# TODO: Remove this and instead run it within the github actions CI on the stable channel once SDK lower bound is >=2.9.3 |
21 | 20 | RUN dartfmt --line-length=120 --dry-run --set-exit-if-changed . |
22 | 21 |
|
23 | | -ARG BUILD_ARTIFACTS_AUDIT=/build/pubspec.lock |
| 22 | +# TODO: Remove these test runs once SDK lower bound is >=2.9.3 |
| 23 | +RUN pub run build_runner test --release -- --preset dart2js --exclude-tags=dart-2-7-dart2js-variadic-issues |
| 24 | +RUN pub run build_runner test -- --preset dartdevc |
24 | 25 |
|
25 | 26 | # We need 2.9.2 to verify the Chrome MemoryInfo workaround: https://github.com/cleandart/react-dart/pull/280 |
26 | 27 | # TODO remove the workaround as well as this config once SDK lower bound is >=2.9.3 |
@@ -67,5 +68,7 @@ ADD . /build/ |
67 | 68 | RUN pub get |
68 | 69 | # Run DDC tests to verify Chrome workaround |
69 | 70 | RUN pub run build_runner test -- --preset dartdevc |
| 71 | +# Run dart2js tests that fail in 2.7 |
| 72 | +RUN pub run build_runner test --release -- --preset dart2js --tags=dart-2-7-dart2js-variadic-issues |
70 | 73 |
|
71 | 74 | FROM scratch |
0 commit comments