-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Adding github action for Visual Studio #1234
Conversation
This is probably fine, but do we need both this and appveyor? I am already uncomfortable that a tiny comment typo push causes such a waste of resources :) Appveyor is creating build artifacts archives, that would be great to improve to generate full binary packages. Is this possible with GitHub actions? |
Maybe we could configure appveyor to build only on tags, and let this github action (it does indeed look a lot more simple and elegant) do the per-commit build. |
Yes github actions can keep the artifcates. Examples: |
I think this is a good idea. We can also improve github action build scripts later to keep the artifacts and remove appveyor altogether in the future. |
Ah, Appveyor has Cygwin build now -- so we may need to add cygwin github action first before going with this idea. |
Your suggestion is good. Just wondering if you can help to suggest how to add the feature to keep the binary for MSVC build. Thanks. |
@Youw |
Fixed. Coding inside of the |
Lets start with the general theory a bit: we want to store some binaries (probably right here on Github) which are produced by the build.
NOTE: Github doesn't provide a generic repo/organisation-level storage (but there used to be - obsolete). The only permanent storage there is on Github - an artifacts attached to a release. I don't think that is what we need right now. The only available alternative - build artifacts bound to a specific build: https://github.com/marketplace/actions/upload-a-build-artifact But that storage is always temporary (see Retention Period). |
I think for the purpose of this PR, we just need to keep the binary files for a specific build. I understand it is a temporary storage. |
I think we can merge this PR first. Later we can discuss whether we want to keep the binaries or not. |
Can you please squash all the fixup commits? |
And if it cannot store artifacts, does it have any advantage over the appveyor builds? |
Oh it can (see here), it is just a matter of getting it done.
At least one thing - all in one place. The build, the logs, etc. - all at github and no additional integration is needed. But there is a drawback: this build actually checks a lot less than the Appveyor version (only Latest Windows/Visual Studio and only a single (latest) toolset). |
Could seem like a pragmatic advantage. On a general note though, if we all stop supporting the alternatives we may well be finding ourselves without alternatives one day. |
Just a convenience I'd say. Regarding the alternatives note. This doesn't seem like a replacement for Appveyor builds - only additional alternative. BTW: @mcuee what is the original reason to have this? As a potential way to store automatic artifacts, or is there other reason? |
The idea is to have github action for Windows. To me it is faster than Appveyor. Then the next step is to keep the artifacts, that is not the original intention of the PR, but rather the next step. |
@Youw |
To make sure you are not screwing up anything while rebasing, just check out a branch copy to work on: |
Thanks for the great help. I have tried your steps and it seems to work. Hope I am doing it correctly. The first step -- I am not so sure what to do so I actually created the new_b branch from the github Web interface using the github_action as the base.
|
Just wondering if you are okay with this PR now. Thanks. |
What is the situation about the artifacts, and the duplication of AppVeyor? |
Hmm, I think we can keep AppVeyor and the artifacts generated by AppVeyor. github action is faster and we can have future PRs to improve this and then totally replace AppVeyor (eg: support more versions of MSVC, keeping the artifacts). But I do not know how to do that myself. |
- uses: actions/checkout@v3 | ||
- uses: microsoft/setup-msbuild@v1.1 | ||
- name: MSBuild ${{ matrix.platform }} | ||
run: msbuild msvc\libusb.sln /p:Configuration=Release /p:Platform=${{ matrix.platform }} |
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.
should use msbuild-architecture instead.
build: | ||
runs-on: windows-latest | ||
strategy: | ||
matrix: |
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.
AppVeyor tests various versions of MSVC. You should use vs-version.
I think I will close this PR first. @neheb |
This PR adds github action for Visual Studio.
Together with the existing MSYS2 github action, this wil address #1045.