Skip to content

Commit 72e41ce

Browse files
authored
Merge pull request #314 from hiroyuki-sato/topic/check_with_github_action_v3
Check with GitHub Actions v3
2 parents b06ef2d + 4bde6dc commit 72e41ce

File tree

1 file changed

+39
-17
lines changed

1 file changed

+39
-17
lines changed

.github/workflows/build.yml renamed to .github/workflows/check.yml

Lines changed: 39 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
name: Build and test
1+
name: Check
22
on: push
33
jobs:
44
mysql:
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
@@ -16,12 +19,13 @@ jobs:
1619
MYSQL_USER: ci
1720
MYSQL_PASSWORD: password
1821
steps:
19-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v3
2023
- name: Set up JDK 8
21-
uses: actions/setup-java@v2
24+
uses: actions/setup-java@v3
2225
with:
2326
java-version: 8
24-
distribution: 'zulu'
27+
distribution: 'temurin'
28+
cache: "gradle"
2529
- name: Connect
2630
run: mysql -h 127.0.0.1 --port 3306 -uroot -proot -e "show databases;"
2731
- name: Create database
@@ -31,13 +35,18 @@ jobs:
3135
env:
3236
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
3337
EMBULK_OUTPUT_MYSQL_TEST_CONFIG: "${{ github.workspace }}/ci/mysql.yml"
34-
- uses: actions/upload-artifact@v2
38+
- uses: actions/upload-artifact@v3
3539
if: always()
3640
with:
3741
name: mysql
3842
path: embulk-output-mysql/build/reports/tests/test
3943
postgresql:
4044
runs-on: ubuntu-latest
45+
# push: always run.
46+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
47+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
48+
strategy:
49+
fail-fast: false
4150
services:
4251
postgres:
4352
image: postgres:9.4
@@ -47,12 +56,13 @@ jobs:
4756
env:
4857
POSTGRES_PASSWORD: postgres
4958
steps:
50-
- uses: actions/checkout@v2
59+
- uses: actions/checkout@v3
5160
- name: Set up JDK 8
52-
uses: actions/setup-java@v2
61+
uses: actions/setup-java@v3
5362
with:
5463
java-version: 8
55-
distribution: 'zulu'
64+
distribution: 'temurin'
65+
cache: "gradle"
5666
- name: Connect
5767
run: psql -h 127.0.0.1 -p 5432 -U postgres -d postgres -c "\l"
5868
env:
@@ -66,13 +76,18 @@ jobs:
6676
env:
6777
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
6878
EMBULK_OUTPUT_POSTGRESQL_TEST_CONFIG: "${{ github.workspace }}/ci/postgresql.yml"
69-
- uses: actions/upload-artifact@v2
79+
- uses: actions/upload-artifact@v3
7080
if: always()
7181
with:
7282
name: postgresql
7383
path: embulk-output-postgresql/build/reports/tests/test
7484
redshift:
7585
runs-on: ubuntu-latest
86+
# push: always run.
87+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
88+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
89+
strategy:
90+
fail-fast: false
7691
# Testing embulk-output-redshift emulated with PostgreSQL.
7792
services:
7893
postgres:
@@ -83,12 +98,13 @@ jobs:
8398
env:
8499
POSTGRES_PASSWORD: postgres
85100
steps:
86-
- uses: actions/checkout@v2
101+
- uses: actions/checkout@v3
87102
- name: Set up JDK 8
88-
uses: actions/setup-java@v2
103+
uses: actions/setup-java@v3
89104
with:
90105
java-version: 8
91-
distribution: 'zulu'
106+
distribution: 'temurin'
107+
cache: "gradle"
92108
- name: Connect
93109
run: psql -h 127.0.0.1 -p 5439 -U postgres -d postgres -c "\l"
94110
env:
@@ -102,20 +118,26 @@ jobs:
102118
env:
103119
_JAVA_OPTIONS: "-Xmx2048m -Xms512m"
104120
EMBULK_OUTPUT_REDSHIFT_TEST_CONFIG: "${{ github.workspace }}/ci/redshift.yml"
105-
- uses: actions/upload-artifact@v2
121+
- uses: actions/upload-artifact@v3
106122
if: always()
107123
with:
108124
name: redshift
109125
path: embulk-output-redshift/build/reports/tests/test
110126
if-no-files-found: ignore
111127
sqlserver:
112128
runs-on: ubuntu-latest
129+
# push: always run.
130+
# pull_request: run only when the PR is submitted from a forked repository, not within this repository.
131+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
132+
strategy:
133+
fail-fast: false
113134
steps:
114-
- uses: actions/checkout@v2
135+
- uses: actions/checkout@v3
115136
- name: Set up JDK 8
116-
uses: actions/setup-java@v2
137+
uses: actions/setup-java@v3
117138
with:
118139
java-version: 8
119-
distribution: 'zulu'
140+
distribution: 'temurin'
141+
cache: "gradle"
120142
- name: Build-only
121143
run: ./gradlew --stacktrace :embulk-output-sqlserver:compileJava :embulk-output-sqlserver:compileTestJava

0 commit comments

Comments
 (0)