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

.github: add tests to CI #82

Merged
merged 1 commit into from May 13, 2024
Merged

.github: add tests to CI #82

merged 1 commit into from May 13, 2024

Conversation

crawshaw
Copy link
Member

No description provided.


on:
push:
branches: [ $default-branch ]
Copy link
Member

Choose a reason for hiding this comment

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

Does this work here? I thought this was only for templates.

Do we need ${{ github.event.repository.default_branch }} ?

Copy link
Member Author

Choose a reason for hiding this comment

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

look, all I do is copy the yaml from one file to another file. none of this makes any sense to me!

Copy link
Member Author

Choose a reason for hiding this comment

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

ooh it worked this time!

lmk if you have a shorter form of this.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I mean I just put in the specific name. It's not like default branch names change all that often anyway.

push:
branches: [ main ]
pull_request:
branches: [ main ]
Copy link
Member

Choose a reason for hiding this comment

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

Consider maybe also

types: [opened, reopened, synchronize]

Copy link
Member Author

Choose a reason for hiding this comment

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

what does that do? (it seems to re-run on pushing to a PR already)

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I meant that instead of specifying the branch for a PR, since we presumably want the tests to run not just for main.

Copy link
Member

Choose a reason for hiding this comment

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

To be more specific:

on:
  push:
    branches:
      - main
  pull_request:
    types: [opened, reopened, synchronize]

(syntax mutatis mutandis)

branches: [ main ]
pull_request:
branches: [ main ]

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
permissions:
contents: read

though it is possible that is the default now.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it is. Going to skip this on the principle that fewer lines is better.

Copy link
Member

Choose a reason for hiding this comment

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

It looks like the default is read-all, which is more general (e.g., it allows access to readable properties of the repo besides the files), but that is probably not a big issue.

run: go build -v ./...

- name: Test
run: go test -v ./...
Copy link
Member

Choose a reason for hiding this comment

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

-race ? 😄

@raggi
Copy link
Member

raggi commented May 13, 2024

@creachadair i bumped this, added race as you suggested, LGTY?

Copy link
Member

@creachadair creachadair left a comment

Choose a reason for hiding this comment

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

I had forgotten about the existence of this PR, but yes, still LGTM. 😆

@raggi raggi merged commit 9961a0c into main May 13, 2024
1 check passed
@raggi raggi deleted the crawshaw/testsqlite branch May 13, 2024 22:45
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.

None yet

3 participants