Skip to content

Update GHA for matrix build #151

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

Merged
merged 1 commit into from
Oct 24, 2022
Merged

Update GHA for matrix build #151

merged 1 commit into from
Oct 24, 2022

Conversation

rpunt
Copy link
Contributor

@rpunt rpunt commented Sep 4, 2022

No description provided.

@rpunt
Copy link
Contributor Author

rpunt commented Sep 4, 2022

Per suggestion in #97

@rpunt
Copy link
Contributor Author

rpunt commented Sep 4, 2022

deitch
deitch previously approved these changes Sep 5, 2022
@deitch
Copy link
Collaborator

deitch commented Sep 5, 2022

Let CI run.

@deitch
Copy link
Collaborator

deitch commented Sep 5, 2022

CI is unhappy.

@yadutaf
Copy link
Contributor

yadutaf commented Oct 14, 2022

I'd love to see this merged!

If it helps, the build fix is trivial:

diff --git a/diskfs_unix.go b/diskfs_unix.go
index 31a94a4..3f364e1 100644
--- a/diskfs_unix.go
+++ b/diskfs_unix.go
@@ -1,5 +1,5 @@
-//go:build !darwin || linux || solaris || aix || freebsd || illumos || netbsd || openbsd || plan9
-// +build !darwin linux solaris aix freebsd illumos netbsd openbsd plan9
+//go:build linux || solaris || aix || freebsd || illumos || netbsd || openbsd || plan9
+// +build linux solaris aix freebsd illumos netbsd openbsd plan9
 
 package diskfs

A manual check with:

GOOS=darwin go build
GOOS=windows go build
GOOS=linux go build

Confirms that at least the build passes (not actually tested on target, though)

If it helps, I can open a PR for this fix, but it would be completely OK with me to just apply directly it on this PR!

@deitch
Copy link
Collaborator

deitch commented Oct 16, 2022

Either fix is fine. I am happy to see this merged in once CI is clean.

@yadutaf
Copy link
Contributor

yadutaf commented Oct 16, 2022

@rpunt would you be interested in integrating this proposed fix in your PR ?

rpunt added a commit to rpunt/go-diskfs that referenced this pull request Oct 16, 2022
@rpunt
Copy link
Contributor Author

rpunt commented Oct 16, 2022

@deitch just added to my branch and pushed, let's see how it does.

Thanks @yadutaf !

@rpunt rpunt closed this Oct 16, 2022
@rpunt rpunt reopened this Oct 16, 2022
deitch
deitch previously approved these changes Oct 18, 2022
@deitch
Copy link
Collaborator

deitch commented Oct 18, 2022

CI is unhappy about something. Also, should squash into a single commit.

@yadutaf
Copy link
Contributor

yadutaf commented Oct 18, 2022

It looks like the CI is unhappy because docker is not installed on the macos image. This somehow makes sense because the docker image would run in Linux VM under the hood, which is strictly equivalent to just run on Linux directly 😄

Since the Makefile and the test suite already make it easily possible to select whether we want to run the docker-based tests or not, maybe a good approach could be:

  • linux: run make test
  • macos / windows: run make unit-test (EDIT: and skip make image)

Would this approach make sense ? I'm not familiar with GitHub actions, so I'm not sure if this could be implemented.

@deitch
Copy link
Collaborator

deitch commented Oct 19, 2022

We may not have much of a choice. Much as I would want make test to run on all platforms, it depends on the docker image TEST_IMAGE, which has utilities for validating the output.

OK, let's go with your approach:

  • make image and make test on linux
  • make unit-test on macOS/windows
  • all of the rest on both

And squash the commits. The easiest may be to add an if statement to the last two lines:

      - name: unit-test
         run: make unit-test
      - name: image
         if: ${{ runner.os == "Linux" }}
         run: make image
       - name: test
         if: ${{ runner.os == "Linux" }}
         run: make test

You could use matrix.os == "ubuntu-latest" if you want, but that ties it to the matrix, which is fine.

@rpunt
Copy link
Contributor Author

rpunt commented Oct 22, 2022

squashed and updated

@rpunt rpunt marked this pull request as draft October 22, 2022 17:53
@rpunt rpunt marked this pull request as ready for review October 22, 2022 18:10
@rpunt
Copy link
Contributor Author

rpunt commented Oct 22, 2022

CI finally passed, with both the additions suggested for Docker images, and by skipping Windows runs for "vet" and "lint"

Copy link
Collaborator

@deitch deitch left a comment

Choose a reason for hiding this comment

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

This looks good, except for the irrelevant Makefile changes. Some impelemntations might not like them either; arguably non-target-specific syntax is not supposed to be tab-indented. I have seen make versions where the following would get ignored:

ifeq ($(BUILDARCH),aarch64)
        BUILDARCH=arm64
endif

but not:

ifeq ($(BUILDARCH),aarch64)
BUILDARCH=arm64
endif

Either way, it is irrelevant to this PR, so please remove, and then we can merge in.

@rpunt rpunt force-pushed the smoketest-gha branch 3 times, most recently from 30bc487 to 973e368 Compare October 23, 2022 14:53
@rpunt rpunt requested a review from deitch October 23, 2022 14:55
@deitch deitch merged commit bf130dd into diskfs:master Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants