Skip to content

Commit

Permalink
Merge pull request #400 from Workiva/add_cdn_publish_back_temporarily
Browse files Browse the repository at this point in the history
Add CDN publish back temporarily
  • Loading branch information
rmconsole4-wk authored Jun 7, 2024
2 parents 0370d08 + 92c3097 commit 79f7a1c
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 13 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/dart_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
# Can't run on `stable` (Dart 3) until we're fully null-safe.
sdk: [2.18.7, 2.19.6]
sdk: [2.19.6]
steps:
- uses: actions/checkout@v2
- uses: dart-lang/setup-dart@v1
Expand All @@ -36,29 +36,21 @@ jobs:

- name: Verify formatting
run: dart run dart_dev format --check
if: ${{ matrix.sdk == '2.18.7' }}
if: ${{ matrix.sdk == '2.19.6' }}

- name: Analyze project source
run: dart analyze
if: always() && steps.install.outcome == 'success'

- name: Run tests (DDC)
run: |
if [ ${{ matrix.sdk }} = '2.13.4' ]; then
dart run build_runner test --delete-conflicting-outputs -- --preset dartdevc-legacy
else
dart run build_runner test --delete-conflicting-outputs -- --preset dartdevc
fi
dart run build_runner test --delete-conflicting-outputs -- --preset dartdevc
if: always() && steps.install.outcome == 'success'
timeout-minutes: 5

- name: Run tests (dart2js)
run: |
if [ ${{ matrix.sdk }} = '2.13.4' ]; then
dart run build_runner test --delete-conflicting-outputs --release -- --preset dart2js-legacy
else
dart run build_runner test --delete-conflicting-outputs --release -- --preset dart2js
fi
dart run build_runner test --delete-conflicting-outputs --release -- --preset dart2js
if: always() && steps.install.outcome == 'success'
timeout-minutes: 5
- uses: anchore/sbom-action@v0
Expand Down
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM drydock-prod.workiva.net/workiva/dart2_base_image:2 as dart2

RUN dart --version

WORKDIR /build
COPY pubspec.yaml .

RUN dart pub get

COPY /lib ./lib/
RUN cd lib && tar -czvf ../cdn_assets.tar.gz *.js *.map
ARG BUILD_ARTIFACTS_CDN=/build/cdn_assets.tar.gz

FROM scratch
3 changes: 2 additions & 1 deletion example/test/react_test_components.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class _ClockComponent extends react.Component {

@override
render() {
return react.span({'onClick': (event) => print('Hello World!')},
return react.span(
{'onClick': (event) => print('Hello World!')},
// { 'onClick': (event, [domid = null]) => print("Hello World!") },
['Seconds elapsed: ', "${state['secondsElapsed']}"]);
}
Expand Down
36 changes: 36 additions & 0 deletions skynet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: validate_cdn_artifact
description: Verifies the cdn artifact generated in the build contains the JS bundle files
image: drydock.workiva.net/workiva/skynet-images:node-test-image-latest
size: large
timeout: 900

requires:
Workiva/react-dart:
- cdn

scripts:
- mkdir build
- cp $SKYNET_APPLICATION_REACT_DART_CDN ./build
- cd build
- tar -xf cdn_assets.tar.gz
- test -e ./react.js && { echo 'Verified dev bundle exists in CDN artifact.'; } || { echo 'Dev bundle /lib/react.js should exist in CDN artifact.'; exit 1; }
- test -e ./react_dom.js && { echo 'Verified dev DOM bundle exists in CDN artifact.'; } || { echo 'Dev DOM bundle /lib/react_dom.js should exist in CDN artifact.'; exit 1; }
- test -e ./react_with_react_dom_prod.js && { echo 'Verified prod bundle exists in CDN artifact.'; } || { echo 'Prod bundle /lib/react_with_react_dom_prod.js should exist in CDN artifact.'; exit 1; }
- test -e ./react_prod.js && { echo 'Verified prod bundle exists in CDN artifact.'; } || { echo 'Prod bundle /lib/react_prod.js should exist in CDN artifact.'; exit 1; }
- test -e ./react_dom_prod.js && { echo 'Verified prod DOM bundle exists in CDN artifact.'; } || { echo 'Prod DOM bundle /lib/react_dom_prod.js should exist in CDN artifact.'; exit 1; }

---

name: verify-github-actions
description: Verify that the github actions run passed, this is needed to make pipelines pass without manual intervention
contact: 'Frontend Frameworks Architecture / #support-frontend-architecture'
image: drydock.workiva.net/workiva/skynet-images:3728345 # Uses the image from this branch: https://github.com/Workiva/skynet-images/pull/127
size: small
timeout: 600

env:
# encrypted github token used for requests to api.github.com
- secure: wqV2dUVmOMNZgll+/Sr4fra76p+gTvqRS3QvNQASg3hzoysFz7enBaKsXKXoPFj+jexOvFVN/m4rko272z/xZ6lBMRI=

scripts:
- python3 /actions/verify_github_actions.py

0 comments on commit 79f7a1c

Please sign in to comment.