diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/build-and-tests.yaml similarity index 83% rename from .github/workflows/pull_request.yaml rename to .github/workflows/build-and-tests.yaml index e239752..0521949 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/build-and-tests.yaml @@ -1,11 +1,12 @@ -name: Pull Request +name: Build and Tests on: - pull_request: - branches: ["main"] - -env: - CARGO_TERM_COLOR: always + workflow_call: + inputs: + ref: + required: false + type: string + description: "The branch, tag or SHA to checkout. Defaults to the current SHA." jobs: build: diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml new file mode 100644 index 0000000..0192e33 --- /dev/null +++ b/.github/workflows/pull-request.yaml @@ -0,0 +1,15 @@ +name: Pull Request + +on: + pull_request: + branches: + - main + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + uses: ./.github/workflows/build-and-tests.yaml + with: + ref: ${{ github.event.pull_request.head.sha }} \ No newline at end of file diff --git a/.github/workflows/release-plz.yaml b/.github/workflows/release-plz.yaml index 6890b1e..b6c0c1b 100644 --- a/.github/workflows/release-plz.yaml +++ b/.github/workflows/release-plz.yaml @@ -10,10 +10,12 @@ on: - main jobs: + test: + uses: ./.github/workflows/test.yaml - # Release unpublished packages. release-plz-release: name: Release-plz release + needs: test runs-on: ubuntu-latest if: ${{ github.repository_owner == 'thiagodejesus' }} permissions: @@ -33,9 +35,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - # Create a PR with the new versions and changelog, preparing the next release. release-plz-pr: name: Release-plz PR + needs: test runs-on: ubuntu-latest if: ${{ github.repository_owner == 'thiagodejesus' }} permissions: @@ -57,4 +59,4 @@ jobs: command: release-pr env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}