From 04c45e4362d401690e998f38daf275b6154942f6 Mon Sep 17 00:00:00 2001 From: cantaylancapraz <77298084+cantaylancapraz@users.noreply.github.com> Date: Mon, 26 Feb 2024 13:06:38 +0300 Subject: [PATCH] add verification on pull requests (#4) add verification on pull requests --- .github/workflows/publish.yaml | 32 ++++-------------------------- .github/workflows/verify.yaml | 36 ++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/verify.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 30e9e6d..9cbda93 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,39 +1,15 @@ -name: Publish +name: Verify on: push: tags: - '*' jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: setup java - uses: actions/setup-java@v4 - with: - java-version: "21" - architecture: x64 - distribution: oracle - cache: 'gradle' - - name: Lint - run: ./gradlew lintKotlin - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: setup java - uses: actions/setup-java@v4 - with: - java-version: "21" - architecture: x64 - distribution: oracle - cache: 'gradle' - - name: Test - run: ./gradlew test + verify: + uses: ./.github/workflows/verify.yaml publish: runs-on: ubuntu-latest - needs: [ lint, test ] + needs: [ verify ] steps: - uses: actions/checkout@v4 - name: setup java diff --git a/.github/workflows/verify.yaml b/.github/workflows/verify.yaml new file mode 100644 index 0000000..a194087 --- /dev/null +++ b/.github/workflows/verify.yaml @@ -0,0 +1,36 @@ +name: Publish +on: + pull_request: + workflow_call: + push: + branches: [ 'master' ] + # Don't run on tags, publish will call this workflow + tags-ignore: [ '**' ] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: setup java + uses: actions/setup-java@v4 + with: + java-version: "21" + architecture: x64 + distribution: oracle + cache: 'gradle' + - name: Lint + run: ./gradlew lintKotlin + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: setup java + uses: actions/setup-java@v4 + with: + java-version: "21" + architecture: x64 + distribution: oracle + cache: 'gradle' + - name: Test + run: ./gradlew test