Skip to content

Commit 277cf61

Browse files
Merge pull request #297 from Workiva/gh-actions-ci
Set up Github actions CI
2 parents c9197eb + 76147d6 commit 277cf61

File tree

3 files changed

+55
-15
lines changed

3 files changed

+55
-15
lines changed

.github/workflows/dart_ci.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Dart CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
sdk: [stable, dev]
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: dart-lang/[email protected]
19+
with:
20+
channel: ${{ matrix.sdk }}
21+
22+
- name: Print Dart SDK version
23+
run: dart --version
24+
25+
- id: install
26+
name: Install dependencies
27+
run: dart pub get
28+
29+
- name: Validate dependencies
30+
run: dart pub run dependency_validator -i build_runner,build_test,build_web_compilers
31+
if: always() && steps.install.outcome == 'success'
32+
33+
# TODO: Uncomment this, and remove the Dart 2.7.2 format step in the Workiva Build Dockerfile
34+
# once we are able to bump the lower bound of SDK.
35+
# - name: Verify formatting
36+
# run: dart format --output=none --line-length=120 --set-exit-if-changed .
37+
# if: always() && ${{ matrix.sdk }} == 'stable' && steps.install.outcome == 'success'
38+
39+
- name: Analyze project source
40+
run: dart analyze
41+
if: always() && steps.install.outcome == 'success'
42+
43+
- name: Run tests (DDC)
44+
run: dart pub run build_runner test -- --preset dartdevc
45+
if: always() && steps.install.outcome == 'success'
46+
47+
- name: Run tests (dart2js)
48+
run: dart pub run build_runner test --release -- --preset dart2js
49+
if: always() && steps.install.outcome == 'success'

Dockerfile

+5-14
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,14 @@ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key
1616
# Fail the build if the version doesn't match what we expected
1717
RUN google-chrome --version | grep " $EXPECTED_CHROME_VERSION\."
1818

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 .
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
2220
RUN dartfmt --line-length=120 --dry-run --set-exit-if-changed .
2321

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
22+
# TODO: Remove these test runs once SDK lower bound is >=2.9.3
2723
RUN pub run build_runner test --release -- --preset dart2js --exclude-tags=dart-2-7-dart2js-variadic-issues
2824
RUN pub run build_runner test -- --preset dartdevc
2925

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
26+
# We need 2.9.2 to verify the Chrome MemoryInfo workaround: https://github.com/cleandart/react-dart/pull/280
3527
# TODO remove the workaround as well as this config once SDK lower bound is >=2.9.3
3628
FROM google/dart:2.9.2
3729
RUN dart --version
@@ -74,10 +66,9 @@ WORKDIR /build/
7466
ADD . /build/
7567

7668
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
7969
# Run DDC tests to verify Chrome workaround
8070
RUN pub run build_runner test -- --preset dartdevc
81-
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
8273

8374
FROM scratch

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Pub](https://img.shields.io/pub/v/react.svg)](https://pub.dev/packages/react)
44
![ReactJS v16.10.1](https://img.shields.io/badge/React_JS-v16.10.1-green.svg)
5-
[![Build Status](https://travis-ci.com/cleandart/react-dart.svg?branch=master)](https://travis-ci.com/cleandart/react-dart)
5+
[![Dart CI](https://github.com/Workiva/react-dart/workflows/Dart%20CI/badge.svg?branch=master)](https://github.com/Workiva/react-dart/actions?query=workflow%3A%22Dart+CI%22+branch%3Amaster)
66
[![React Dart API Docs](https://img.shields.io/badge/api_docs-react-blue.svg)](https://pub.dev/documentation/react/latest/)
77

88
_Thanks to the folks at [Vacuumlabs](https://www.vacuumlabs.com/) for creating this project! :heart:_

0 commit comments

Comments
 (0)