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
Create dart.yml #82
Create dart.yml #82
Conversation
Thanks @domesticmouse! Can you please start by aligning with https://github.com/dart-lang/.github/blob/master/workflow-templates/test-package.yaml (there are some key differences, e.g. which setup task to use). @athomas fyi that Brett is looking at this repo. |
@mit-mit I'm unsure how I can align this script with another package when the intent was to port the current test suite from Travis to Github Actions. @athomas if you want to own this and move it forward, please do so. At this point I don't understand how the current Travis test suite actually worked. |
My comment was to align on steps that are actually similar, e.g. use |
.github/workflows/dart.yml
Outdated
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: cedx/setup-dart@v2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer dart-lang/setup-dart@v0.1
Note that that will use channel
instead of release-channel
for the parameter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
.github/workflows/dart.yml
Outdated
with: | ||
release-channel: ${{ matrix.sdk }} | ||
|
||
- name: Print Dart SDK version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this step if you use dart-lang/setup-dart it will print the version it selects already in setup-dart.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and done.
- name: Print Dart SDK version | ||
run: dart --version | ||
|
||
- name: "PKGS: command_line, extension_methods, ffi/hello_world, ffi/primitives, ffi/structs, ffi/system-command, native_app; TASKS: `dartanalyzer --fatal-infos --fatal-warnings .`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to move analysis and formatting to their own job (it doesn't need to run on all OS'es and can run before all other jobs). See https://github.com/dart-lang/.github/blob/master/workflow-templates/test-package.yaml#L15
- name: Print Dart SDK version | ||
run: dart --version | ||
|
||
- name: "PKGS: command_line, extension_methods, ffi/hello_world, ffi/primitives, ffi/structs, ffi/system-command, native_app; TASKS: `dartanalyzer --fatal-infos --fatal-warnings .`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider switching to dart analyze --fatal-infos
, which should do the same as the legacy command you're currently using (--fatal-warnings
is enabled by default in dart analyze
).
PKGS: "command_line extension_methods ffi/hello_world ffi/primitives ffi/structs ffi/system-command native_app" | ||
run: ./tool/travis.sh dartanalyzer | ||
|
||
- name: "PKGS: command_line, extension_methods, ffi/hello_world, ffi/primitives, ffi/structs, ffi/system-command, native_app; TASKS: `dartfmt -n --set-exit-if-changed .`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider switching to dart format --output=none --set-exit-if-changed .
, which should do the same as the legacy command you're currently using.
PKGS: "command_line extension_methods ffi/hello_world ffi/primitives ffi/structs ffi/system-command native_app" | ||
run: ./tool/travis.sh dartanalyzer | ||
|
||
- name: "PKGS: command_line, extension_methods, ffi/hello_world, ffi/primitives, ffi/structs, ffi/system-command, native_app; TASKS: `dartfmt -n --set-exit-if-changed .`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider running this even if analysis fails, because it's annoying to fix all your analysis errors only to discover that there is also a formatting error, see:
https://github.com/dart-lang/.github/blob/master/workflow-templates/test-package.yaml#L34
PKGS: "command_line extension_methods ffi/hello_world ffi/primitives ffi/structs ffi/system-command native_app" | ||
run: ./tool/travis.sh dartfmt | ||
|
||
- name: "PKG: command_line, extension_methods, ffi/hello_world, ffi/primitives; TASKS: `pub run test`" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider switching to dart test
.
Not sure about travis, but GitHub Actions uses the bash shell coming with the Git installer for Windows. Most CI systems will install git that way and add it to the path, therefore having a bash executable even on Windows. |
Use dart-lang/setup-dart@v0.1
That doesn't look like bash. And it should fail. |
Hey @johnpryan, I suspect I'm doing this backwards. Do you have some input on how we should do this? @kevmoo does |
Yeah |
@johnpryan given you have a |
Yes, powershell is the default shell on windows for GitHub Actions, but bash is available: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell That it works from powershell indicates the |
Opening #83 |
Created per @kevmoo's request in #81 (comment)
Hey @RedBrogdon and @johnpryan,
I started porting the travis test set to Github Actions and I hit something of a head scratcher. I realised that our Travis tests purport to run tests on windows... using a shell script runner. Which makes almost no sense. Unless the Travis windows machines have cygwin or similar installed.
Note, the windows tests appear to pass, even though some of the tests are specifically written for linux only (and test for the presence of a generated .so file ... as opposed to the .dll or .dylib that should be created on Windows and macOS respectively.