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

release.yml run build before creating new tag #3032

Merged
merged 5 commits into from
Sep 12, 2023
Merged

Conversation

guscarreon
Copy link
Contributor

Github actions release.yml is tagging before verifying whether or not the code compiles sucessfully. This led to tags 0.268.0 and 0.269.0 to both point to the same commit when the former's release failed. This pull request makes release.yml pull from current master branch and perform a build before moving on to create a new tag.

Comment on lines 40 to 48
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 0
- name: Build
uses: actions/checkout@master
uses: skx/github-action-build@master
with:
builder: make
Copy link
Contributor

@onkarvhanumante onkarvhanumante Aug 16, 2023

Choose a reason for hiding this comment

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

few points here,

  • The two steps mentioned above checkouts master branch twice. Instead, we can checkout the branch once and then proceeding to the build step.
  • Build command will run successful even if certain unit tests fail. Should also execute the validate.sh script
  • Also should add if condition to check if hasWritePermission is true
 build-master:
    name: Build master
    needs: check-permission
    if: contains(needs.check-permission.outputs.hasWritePermission, 'true')
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@master
        with:
          fetch-depth: 0
          repository: ${{ github.repository }}
          ref: master
      - name: Validate and build
        run: |
          ./validate.sh
          make build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the reivew. Addressed your comments in 9477772

The two steps mentioned above checkouts master branch twice. Instead, we can checkout the branch once and then proceeding to the build step.

Copy/paste error. Corrected

Build command will run successful even if certain unit tests fail. Should also execute the validate.sh script

Good point. Added. I ran the make command before validate though

Also should add if condition to check if hasWritePermission is true

Added

@onkarvhanumante onkarvhanumante self-assigned this Aug 16, 2023
@hhhjort hhhjort self-requested a review August 21, 2023 17:45
@hhhjort hhhjort self-assigned this Aug 21, 2023
Comment on lines 49 to 50
go build .
./validate.sh
go build .
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏼

- name: Build and validate
run: |
./validate.sh
go build .
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am not sure we need the go build . I don't think it is possible for it not to compile, but still manage to pass all the unit tests,

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree go build . command will execute successfully only if all tests pass. Can update script to only run validate.sh

       - name:  Validate 
         run: ./validate.sh
         

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. Removed

hhhjort
hhhjort previously approved these changes Aug 31, 2023
Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

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

Looks good other than the one quibble.

@guscarreon guscarreon dismissed stale reviews from hhhjort and onkarvhanumante via bdd780f September 7, 2023 05:05
Copy link
Collaborator

@hhhjort hhhjort left a comment

Choose a reason for hiding this comment

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

LGTM

@hhhjort hhhjort merged commit 3d4eda5 into master Sep 12, 2023
3 checks passed
@SyntaxNode SyntaxNode deleted the buildBeforeTag branch October 2, 2023 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants