Skip to content

Add a GitHub Actions build workflow #19

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
Apr 20, 2022

Conversation

ltrzesniewski
Copy link
Contributor

Let's inaugurate the pull requests 🙂

Here's a suggestion: you may use GitHub Actions for continuous integration. If you merge this, each time you push or receive a pull request, GitHub will build and test the code, then report success or failure with a ✔️ or ❌ sign on the commit or PR.

I wrote a very basic workflow (see the YAML file, it is pretty self-explanatory), but you may expand this to include more config options or combinations of options.

You can also see an example of a run in my fork, or consult the documentation.

@PhilipHazel
Copy link
Collaborator

Thanks for the suggestion. I am a newbie to both Git and GitHub, and I'm not sure that I'm ready for sophistications like this yet. Also, there is currently a Release Candidate out for testing, so non-urgent changes are frozen (and I'm busy on an entirely different project).

@ltrzesniewski
Copy link
Contributor Author

No worries, take your time, and merge or close this when you're comfortable with it. I know you're new to GitHub, that's why I wanted to show what it's capable of.

As for the release, if you decide to merge this then I suppose you shouldn't include the .github directory in the package, as it's only relevant to GitHub.

@PhilipHazel PhilipHazel merged commit 3fec24a into PCRE2Project:master Apr 20, 2022
@ltrzesniewski ltrzesniewski deleted the github-actions-build branch April 20, 2022 07:53
@PhilipHazel
Copy link
Collaborator

I have finally got round to merging this and will now research what it can do (including #10).

@ltrzesniewski
Copy link
Contributor Author

Ok, let me know if you need any help. Testing with Alpine will require using a container, which will be a bit more difficult than the simple workflow I made here.

I recommend testing workflow changes on another branch, as it may require several attempts in order to make them work.

@PhilipHazel
Copy link
Collaborator

PhilipHazel commented Apr 20, 2022 via email

@ltrzesniewski
Copy link
Contributor Author

The workflow is configured to run automatically:

  • Every time you push, on any branch. If you push several commits at once, it will run on the last commit.
  • Each time someone submits a PR, or adds a commit to a PR. This is useful for quickly making sure a PR is viable.

This means that, normally, you shouldn't need to run a workflow manually. If you want to test a change, all you need to do is push it. That's why I recommended testing workflow changes on a different branch: you may need to push several small commits, and squash them to a single commit on the master branch when you're satisfied (this will keep a clean history on the master branch).

But if you want to run a workflow a second time on the same commit, you can already do that without any change. Open the run, and you'll see a "Re-run all jobs" button on the right:

image

You may also re-run a single job:

image

(there's currently a single job in the workflow, but you may want to add a second one for Alpine)

@PhilipHazel
Copy link
Collaborator

PhilipHazel commented Apr 20, 2022 via email

@ltrzesniewski
Copy link
Contributor Author

ltrzesniewski commented Apr 21, 2022

Another point is that I used libc but in #10 it says Alpine uses musl. Perhaps I should change to use that

Yes, I think the main goal of using Alpine is to test PCRE2 with musl. @carenas suggested installing musl-dev instead of libc-dev.

It would be useful somehow to see the output from the RunGrepTest script.

The workflow will display any output of the specified commands. I used make check for simplicity, but it looks like it discards the output of the commands. You may split this step into 3 separate steps which call the test scripts directly. This should display their output.

@carenas
Copy link
Contributor

carenas commented Apr 21, 2022

Alpine's failure is because of the reordering of the callout output and corresponds to the following log (extracted from RunGrepTest.log) output:

Testing pcre2grep script callouts
--- ./testdata/grepoutputC
+++ testtrygrep
@@ -1,22 +1,22 @@
 Arg1: [T] [he ] [ ] Arg2: |T| () () (0)
+The quick brown
 Arg1: [T] [his] [s] Arg2: |T| () () (0)
 Arg1: [T] [his] [s] Arg2: |T| () () (0)
 Arg1: [T] [he ] [ ] Arg2: |T| () () (0)
 Arg1: [T] [he ] [ ] Arg2: |T| () () (0)
 Arg1: [T] [he ] [ ] Arg2: |T| () () (0)
-The quick brown
 This time it jumps and jumps and jumps.
 This line contains \E and (regex) *meta* [characters].
 The word is cat in this line
 The caterpillar sat on the mat
 The snowcat is not an animal
 Arg1: [qu] [qu]
+The quick brown
 Arg1: [ t] [ t]
 Arg1: [ l] [ l]
 Arg1: [wo] [wo]
 Arg1: [ca] [ca]
 Arg1: [sn] [sn]
-The quick brown
 This time it jumps and jumps and jumps.
 This line contains \E and (regex) *meta* [characters].
 The word is cat in this line
FAIL RunGrepTest (exit status: 1)

@PhilipHazel
Copy link
Collaborator

PhilipHazel commented Apr 22, 2022 via email

@PhilipHazel
Copy link
Collaborator

PhilipHazel commented Oct 11, 2022 via email

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