Skip to content

Commit

Permalink
ci: update global workflows (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
asyncapi-bot authored Feb 8, 2022
1 parent 6a960a7 commit d8b3364
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/if-go-pr-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ on:

jobs:
lint:
if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))"
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))"
id: should_run
name: Should Run
run: echo "::set-output name=shouldrun::true"
- if: steps.should_run.outputs.shouldrun == 'true'
name: Checkout repository
uses: actions/checkout@v2
- name: Check if Go project and has go.mod
- if: steps.should_run.outputs.shouldrun == 'true'
name: Check if Go project and has go.mod
id: gomod
run: test -e ./go.mod && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
shell: bash
Expand All @@ -31,16 +36,21 @@ jobs:
skip-go-installation: true # we wanna control the version of Go in use

test:
if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))"
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout repository
- if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))"
id: should_run
name: Should Run
run: echo "::set-output name=shouldrun::true"
- if: steps.should_run.outputs.shouldrun == 'true'
name: Checkout repository
uses: actions/checkout@v2
- name: Check if Go project and has go.mod
- if: steps.should_run.outputs.shouldrun == 'true'
name: Check if Go project and has go.mod
id: gomod
run: test -e ./go.mod && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
shell: bash
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/if-nodejs-pr-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,26 @@ on:

jobs:
test:
if: "github.event.pull_request.draft == false && !((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))"
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
- if: "github.event.pull_request.draft == false &&!((github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'ci: update global workflows')) || (github.actor == 'asyncapi-bot' && startsWith(github.event.pull_request.title, 'chore(release):')) || (github.actor == 'allcontributors' && startsWith(github.event.pull_request.title, 'docs: add')))"
id: should_run
name: Should Run
run: echo "::set-output name=shouldrun::true"
- if: steps.should_run.outputs.shouldrun == 'true'
name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout repository
- if: steps.should_run.outputs.shouldrun == 'true'
name: Checkout repository
uses: actions/checkout@v2
- name: Check if Node.js project and has package.json
- if: steps.should_run.outputs.shouldrun == 'true'
name: Check if Node.js project and has package.json
id: packagejson
run: test -e ./package.json && echo "::set-output name=exists::true" || echo "::set-output name=exists::false"
shell: bash
Expand Down

0 comments on commit d8b3364

Please sign in to comment.