Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEA-318: Use github actions instead of travis for CI #189

Merged
merged 15 commits into from
Jun 15, 2022

Conversation

kimlarson-wk
Copy link
Contributor

@kimlarson-wk kimlarson-wk commented Jun 14, 2022

FEA-318

Motivation

The w_module repo is currently using travis for CI. We don't use that anymore.

Changes

Used github actions instead of travis. Added a skynet.yaml.

Release Notes

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Frontend Architecture member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

@aviary-wf
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@kimlarson-wk kimlarson-wk marked this pull request as ready for review June 14, 2022 18:42
@kimlarson-wk kimlarson-wk requested a review from a team June 14, 2022 18:42
@kimlarson-wk kimlarson-wk changed the title Use github actions instead of travis for CI FEA-318: Use github actions instead of travis for CI Jun 14, 2022
Copy link

@corwinsheahan-wf corwinsheahan-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a couple of small things

Comment on lines -19 to -22
- pub run dart_dev format --check
- pub run dart_dev analyze
- pub run dart_dev test
- pub run dart_dev test --release

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this workflow used dart_dev, we'll probably want to do that in the github workflow as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused on why no other workflow does it 🤔

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely because most of them don't actually depend on dart_dev. Looks like at least w_transport uses it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But in general, running dart run dart_dev test is just any other CLI command. There's no reason it can't or shouldn't be used in a github workflow.

@@ -632,17 +632,15 @@ void runTests(bool runSpanTests) {
expect(
Logger.root.onRecord,
emits(
logRecord(level: Level.WARNING, message: contains('loading'))));
logRecord(level: Level.CONFIG, message: contains('loading'))));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What caused this change?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, looks like we had a PR go through which updated a log level: https://github.com/Workiva/w_module/pull/181/files

That was able to sneak through because tests weren't actually being ran.

skynet.yaml Outdated
Comment on lines 1 to 13
name: w_module-unit-tests
description: Unit tests
contact: 'Frontend Frameworks Architecture / #support-frontend-architecture'
image: drydock.workiva.net/workiva/dart_unit_test_image:1
size: large
timeout: 600

artifacts: /testing/w_module/test-reports
test-reports: /testing/w_module/test-reports

scripts:
- cd /testing/w_module/
- ./run_tests.sh

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we already run tests in github workflows, perhaps just no-op here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the benefit of having them run via workflows rather than skynet?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it's so that open source contributors can see the results of a CI run (skynet requires privileged access).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhh

Copy link
Contributor

@evanweible-wf evanweible-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason to move the tests from test/ to test/unit/? In many of our smaller packages, we only have unit tests, so putting them directly in test/ is sufficient/simpler.

Copy link

@corwinsheahan-wf corwinsheahan-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should avoid moving things under test/ to test/unit.

skynet.yaml Outdated
on-pull-request: true

scripts:
- echo "No tests currently set"
Copy link

@corwinsheahan-wf corwinsheahan-wf Jun 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- echo "No tests currently set"
- echo "Tests run in a Github Workflow"

@@ -632,17 +632,15 @@ void runTests(bool runSpanTests) {
expect(
Logger.root.onRecord,
emits(
logRecord(level: Level.WARNING, message: contains('loading'))));
logRecord(level: Level.CONFIG, message: contains('loading'))));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, looks like we had a PR go through which updated a log level: https://github.com/Workiva/w_module/pull/181/files

That was able to sneak through because tests weren't actually being ran.

.github/workflows/dart_ci.yml Show resolved Hide resolved
Comment on lines 34 to 59
run: dart pub run dart_dev analyze
if: always() && steps.install.outcome == 'success'

- name: Run tests with ddc
run: dart pub run dart_dev test
if: always() && steps.install.outcome == 'success'

- name: Run tests with dart2js
run: dart pub run dart_dev test --release
if: always() && steps.install.outcome == 'success'

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dart-lang/[email protected]
with:
sdk: 2.13.4

- id: install
name: Install dependencies
run: dart pub get

- name: Verify formatting
run: dart pub run dart_dev format --check
if: always() && steps.install.outcome == 'success'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#nit the dart cli supports run directly, so I believe we can omit the pub in these commands

Suggested change
run: dart pub run dart_dev analyze
if: always() && steps.install.outcome == 'success'
- name: Run tests with ddc
run: dart pub run dart_dev test
if: always() && steps.install.outcome == 'success'
- name: Run tests with dart2js
run: dart pub run dart_dev test --release
if: always() && steps.install.outcome == 'success'
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dart-lang/[email protected]
with:
sdk: 2.13.4
- id: install
name: Install dependencies
run: dart pub get
- name: Verify formatting
run: dart pub run dart_dev format --check
if: always() && steps.install.outcome == 'success'
run: dart run dart_dev analyze
if: always() && steps.install.outcome == 'success'
- name: Run tests with ddc
run: dart run dart_dev test
if: always() && steps.install.outcome == 'success'
- name: Run tests with dart2js
run: dart run dart_dev test --release
if: always() && steps.install.outcome == 'success'
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dart-lang/[email protected]
with:
sdk: 2.13.4
- id: install
name: Install dependencies
run: dart pub get
- name: Verify formatting
run: dart run dart_dev format --check
if: always() && steps.install.outcome == 'success'

FEA-318
@evanweible-wf
Copy link
Contributor

QA +1

  • CI passes

@evanweible-wf
Copy link
Contributor

@Workiva/release-management-p

Copy link
Contributor

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 from RM

@rmconsole2-wf rmconsole2-wf merged commit 892e6b1 into master Jun 15, 2022
@rmconsole2-wf rmconsole2-wf deleted the FEA-318_UseGithubActions branch June 15, 2022 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants