Skip to content

Commit 836900c

Browse files
authored
Merge pull request #261 from embulk/github-actions-check-strategy-push-or-pull_request
Rename GitHub Actions workflow build to check, add explicit strategy and skip unnecessary run in the workflow
2 parents c4ca1d2 + c665cf3 commit 836900c

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed
Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
name: Build and test
2-
on: [push, pull_request]
1+
name: Check
2+
on: [ pull_request, push ]
33
jobs:
44
mysql5_7:
5+
runs-on: ubuntu-latest
6+
# push: always run.
7+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
8+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
59
strategy:
610
fail-fast: false
7-
runs-on: ubuntu-latest
811
services:
912
mysql:
1013
image: mysql:5.7
@@ -36,9 +39,12 @@ jobs:
3639
name: mysql5_7
3740
path: embulk-input-mysql/build/reports/tests/test
3841
mysql8_3:
42+
runs-on: ubuntu-latest
43+
# push: always run.
44+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
45+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
3946
strategy:
4047
fail-fast: false
41-
runs-on: ubuntu-latest
4248
services:
4349
mysql:
4450
# Due to MySQL 8.4 disabled mysql_native_password by default,
@@ -96,6 +102,11 @@ jobs:
96102
path: embulk-input-mysql/build/reports/tests/test
97103
postgresql9_4:
98104
runs-on: ubuntu-latest
105+
# push: always run.
106+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
107+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
108+
strategy:
109+
fail-fast: false
99110
services:
100111
postgres:
101112
image: postgres:9.4
@@ -132,6 +143,11 @@ jobs:
132143
# Use PostgreSQL 13 at this time.
133144
postgresql13:
134145
runs-on: ubuntu-latest
146+
# push: always run.
147+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
148+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
149+
strategy:
150+
fail-fast: false
135151
services:
136152
postgres:
137153
image: postgres:13
@@ -170,6 +186,11 @@ jobs:
170186
path: embulk-input-postgresql/build/reports/tests/test
171187
redshift:
172188
runs-on: ubuntu-latest
189+
# push: always run.
190+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
191+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
192+
strategy:
193+
fail-fast: false
173194
# Testing embulk-input-redshift emulated with PostgreSQL.
174195
services:
175196
postgres:
@@ -205,6 +226,11 @@ jobs:
205226
path: embulk-input-redshift/build/reports/tests/test
206227
sqlserver: # https://hub.docker.com/_/microsoft-mssql-server
207228
runs-on: ubuntu-latest
229+
# push: always run.
230+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
231+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
232+
strategy:
233+
fail-fast: false
208234
services:
209235
sqlserver:
210236
# To run locallly:

0 commit comments

Comments
 (0)