|
| 1 | +FROM drydock-prod.workiva.net/workiva/dart_build_image:1 |
| 2 | + |
| 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 |
| 15 | + |
| 16 | +# Fail the build if the version doesn't match what we expected |
| 17 | +RUN google-chrome --version | grep " $EXPECTED_CHROME_VERSION\." |
| 18 | + |
| 19 | +# Need to analyze and format since dart_build_image only does it automatically for |
| 20 | +# packages that depend on dart_dev |
| 21 | +RUN dartanalyzer . |
| 22 | +RUN dartfmt --line-length=120 --dry-run --set-exit-if-changed . |
| 23 | + |
| 24 | +RUN pub run dependency_validator -i build_runner,build_test,build_web_compilers |
| 25 | + |
| 26 | +# TODO run tests using dart_unit_test_image in skynet, remove Chrome install |
| 27 | +RUN pub run build_runner test --release -- --preset dart2js --exclude-tags=dart-2-7-dart2js-variadic-issues |
| 28 | +RUN pub run build_runner test -- --preset dartdevc |
| 29 | + |
| 30 | +RUN dart ./tool/run_consumer_tests.dart --orgName Workiva --repoName over_react --testCmd "pub run dart_dev test -P dartdevc" |
| 31 | + |
| 32 | + |
| 33 | +# We need 2.9.2 to verify the Chrome MemoryInfo workaround: https://github.com/cleandart/react-dart/pull/280, |
| 34 | +# and to run the tests that fail in 2.7 |
| 35 | +# TODO remove the workaround as well as this config once SDK lower bound is >=2.9.3 |
| 36 | +FROM google/dart:2.9.2 |
| 37 | +RUN dart --version |
| 38 | + |
| 39 | +# Don't allow the dart package to be updated via apt |
| 40 | +RUN apt-mark hold dart |
| 41 | + |
| 42 | +# Update image - required by aviary |
| 43 | +RUN apt-get update -qq && \ |
| 44 | + apt-get dist-upgrade -y && \ |
| 45 | + apt-get autoremove -y && \ |
| 46 | + apt-get clean all |
| 47 | +# Install deps for Chrome install |
| 48 | +RUN apt-get install -y \ |
| 49 | + build-essential \ |
| 50 | + curl \ |
| 51 | + git \ |
| 52 | + make \ |
| 53 | + parallel \ |
| 54 | + wget \ |
| 55 | + && rm -rf /var/lib/apt/lists/* |
| 56 | + |
| 57 | +# Chrome install taken from https://github.com/Workiva/dart_unit_test_image/blob/master@%7B13-01-2021%7D/Dockerfile |
| 58 | + |
| 59 | +# Set the expected Chrome major version. This allows us to update the expected version when |
| 60 | +# we need to roll out a new version of this base image with a new chrome version as the only change |
| 61 | +ENV EXPECTED_CHROME_VERSION=87 |
| 62 | + |
| 63 | +# Install Chrome |
| 64 | +RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ |
| 65 | + echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' | tee /etc/apt/sources.list.d/google-chrome.list && \ |
| 66 | + apt-get -qq update && apt-get install -y google-chrome-stable && \ |
| 67 | + mv /usr/bin/google-chrome-stable /usr/bin/google-chrome && \ |
| 68 | + sed -i --follow-symlinks -e 's/\"\$HERE\/chrome\"/\"\$HERE\/chrome\" --no-sandbox/g' /usr/bin/google-chrome |
| 69 | + |
| 70 | +# Fail the build if the version doesn't match what we expected |
| 71 | +RUN google-chrome --version | grep " $EXPECTED_CHROME_VERSION\." |
| 72 | + |
| 73 | +WORKDIR /build/ |
| 74 | +ADD . /build/ |
| 75 | + |
| 76 | +RUN pub get |
| 77 | +# Run dart2js tests that fail in 2.7 |
| 78 | +RUN pub run build_runner test --release -- --preset dart2js --tags=dart-2-7-dart2js-variadic-issues |
| 79 | +# Run DDC tests to verify Chrome workaround |
| 80 | +RUN pub run build_runner test -- --preset dartdevc |
| 81 | + |
| 82 | + |
| 83 | +FROM scratch |
0 commit comments