Skip to content

Commit 68374f1

Browse files
authored
chore(CI): Migrate from Travis CI to GitHub Actions
Fix tests on Lucee as well.
1 parent 8467741 commit 68374f1

File tree

10 files changed

+425
-64
lines changed

10 files changed

+425
-64
lines changed

.cfconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"host":"${DB_HOST}",
2626
"password":"${DB_PASSWORD}",
2727
"port":"${DB_PORT}",
28-
"username":"${DB_USER}"
28+
"username":"${DB_USER}",
29+
"bundleName": "org.postgresql.jdbc42",
30+
"bundleVersion": "42.1.4"
2931
}
3032
},
3133
"debuggingEnabled":"no",

.github/workflows/cron.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Cron
2+
3+
on:
4+
schedule:
5+
- cron: 0 0 * * 1
6+
7+
jobs:
8+
tests:
9+
runs-on: ubuntu-latest
10+
name: Tests
11+
strategy:
12+
fail-fast: true
13+
matrix:
14+
cfengine: ["lucee@5", "lucee@be", "adobe@2018", "adobe@be"]
15+
coldbox: ["coldbox@5", "coldbox@6", "coldbox@be"]
16+
javaVersion: ["openjdk8", "openjdk11"]
17+
services:
18+
postgres:
19+
image: postgres:12
20+
env:
21+
POSTGRES_USER: cfmigrations_testing
22+
POSTGRES_PASSWORD: cfmigrations_testing
23+
POSTGRES_DB: cfmigrations_testing
24+
ports:
25+
- 5432
26+
options: >-
27+
--health-cmd pg_isready
28+
--health-interval 10s
29+
--health-timeout 5s
30+
--health-retries 5
31+
steps:
32+
- name: Checkout Repository
33+
uses: actions/checkout@v2
34+
35+
- name: Setup Java JDK
36+
uses: actions/[email protected]
37+
with:
38+
java-version: 11
39+
40+
- name: Set Up CommandBox
41+
uses: elpete/[email protected]
42+
43+
- name: Initial Server Start (so lex extensions are picked up)
44+
env:
45+
DB_HOST: localhost
46+
DB_PORT: ${{ job.services.postgres.ports[5432] }}
47+
DB_NAME: cfmigrations_testing
48+
DB_USER: cfmigrations_testing
49+
DB_PASSWORD: cfmigrations_testing
50+
run: |
51+
box config set modules.commandbox-dotenv.checkEnvPreServerStart=false
52+
box server start cfengine=${{ matrix.cfengine }}
53+
sleep 30
54+
55+
- name: Install dependencies
56+
run: |
57+
box install
58+
box install ${{ matrix.coldbox }} --noSave
59+
60+
- name: Restart server (so extensions are picked up)
61+
env:
62+
DB_HOST: localhost
63+
DB_PORT: ${{ job.services.postgres.ports[5432] }}
64+
DB_NAME: cfmigrations_testing
65+
DB_USER: cfmigrations_testing
66+
DB_PASSWORD: cfmigrations_testing
67+
run: |
68+
box server restart
69+
sleep 30
70+
71+
- name: Run TestBox Tests
72+
env:
73+
DB_HOST: localhost
74+
DB_PORT: ${{ job.services.postgres.ports[5432] }}
75+
DB_NAME: cfmigrations_testing
76+
DB_USER: cfmigrations_testing
77+
DB_PASSWORD: cfmigrations_testing
78+
run: box testbox run

.github/workflows/pr.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: PRs and Branches
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- "main"
7+
- "master"
8+
- "development"
9+
pull_request:
10+
branches:
11+
- main
12+
- master
13+
- development
14+
15+
jobs:
16+
tests:
17+
runs-on: ubuntu-latest
18+
name: Tests
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
cfengine: ["lucee@5", "adobe@2018"]
23+
coldbox: ["coldbox@5", "coldbox@6"]
24+
services:
25+
postgres:
26+
image: postgres:12
27+
env:
28+
POSTGRES_USER: cfmigrations_testing
29+
POSTGRES_PASSWORD: cfmigrations_testing
30+
POSTGRES_DB: cfmigrations_testing
31+
ports:
32+
- 5432
33+
options: >-
34+
--health-cmd pg_isready
35+
--health-interval 10s
36+
--health-timeout 5s
37+
--health-retries 5
38+
steps:
39+
- name: Checkout Repository
40+
uses: actions/checkout@v2
41+
42+
- name: Setup Java JDK
43+
uses: actions/[email protected]
44+
with:
45+
java-version: 11
46+
47+
- name: Set Up CommandBox
48+
uses: elpete/[email protected]
49+
50+
- name: Initial Server Start (so lex extensions are picked up)
51+
env:
52+
DB_HOST: localhost
53+
DB_PORT: ${{ job.services.postgres.ports[5432] }}
54+
DB_NAME: cfmigrations_testing
55+
DB_USER: cfmigrations_testing
56+
DB_PASSWORD: cfmigrations_testing
57+
run: |
58+
box config set modules.commandbox-dotenv.checkEnvPreServerStart=false
59+
box server start cfengine=${{ matrix.cfengine }}
60+
sleep 30
61+
62+
- name: Install dependencies
63+
run: |
64+
box install --verbose
65+
box install ${{ matrix.coldbox }} --noSave
66+
67+
- name: Restart server (so extensions are picked up)
68+
env:
69+
DB_HOST: localhost
70+
DB_PORT: ${{ job.services.postgres.ports[5432] }}
71+
DB_NAME: cfmigrations_testing
72+
DB_USER: cfmigrations_testing
73+
DB_PASSWORD: cfmigrations_testing
74+
run: |
75+
box server restart
76+
sleep 30
77+
78+
- name: Run TestBox Tests
79+
env:
80+
DB_HOST: localhost
81+
DB_PORT: ${{ job.services.postgres.ports[5432] }}
82+
DB_NAME: cfmigrations_testing
83+
DB_USER: cfmigrations_testing
84+
DB_PASSWORD: cfmigrations_testing
85+
run: box testbox run
86+
87+
format:
88+
runs-on: ubuntu-latest
89+
name: Format
90+
steps:
91+
- name: Checkout Repository
92+
uses: actions/checkout@v2
93+
94+
- name: Setup Java JDK
95+
uses: actions/[email protected]
96+
with:
97+
java-version: 11
98+
99+
- name: Set Up CommandBox
100+
uses: elpete/[email protected]
101+
102+
- name: Install CFFormat
103+
run: box install commandbox-cfformat
104+
105+
- name: Run CFFormat
106+
run: box run-script format
107+
108+
- name: Commit Format Changes
109+
uses: stefanzweifel/git-auto-commit-action@v4
110+
with:
111+
commit_message: Apply cfformat changes

.github/workflows/prerelease.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Prerelease
2+
3+
on:
4+
push:
5+
branches:
6+
- development
7+
8+
jobs:
9+
tests:
10+
name: Tests
11+
if: "!contains(github.event.head_commit.message, '__SEMANTIC RELEASE VERSION UPDATE__')"
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: true
15+
matrix:
16+
cfengine: ["lucee@5", "adobe@2018"]
17+
coldbox: ["coldbox@5", "coldbox@6"]
18+
services:
19+
postgres:
20+
image: postgres:12
21+
env:
22+
POSTGRES_USER: cfmigrations_testing
23+
POSTGRES_PASSWORD: cfmigrations_testing
24+
POSTGRES_DB: cfmigrations_testing
25+
ports:
26+
- 5432
27+
options: >-
28+
--health-cmd pg_isready
29+
--health-interval 10s
30+
--health-timeout 5s
31+
--health-retries 5
32+
steps:
33+
- name: Checkout Repository
34+
uses: actions/checkout@v2
35+
36+
- name: Setup Java JDK
37+
uses: actions/[email protected]
38+
with:
39+
java-version: 11
40+
41+
- name: Set Up CommandBox
42+
uses: elpete/[email protected]
43+
44+
- name: Initial Server Start (so lex extensions are picked up)
45+
env:
46+
DB_HOST: localhost
47+
DB_PORT: ${{ job.services.postgres.ports[5432] }}
48+
DB_NAME: cfmigrations_testing
49+
DB_USER: cfmigrations_testing
50+
DB_PASSWORD: cfmigrations_testing
51+
run: |
52+
box config set modules.commandbox-dotenv.checkEnvPreServerStart=false
53+
box server start cfengine=${{ matrix.cfengine }}
54+
sleep 30
55+
56+
- name: Install dependencies
57+
run: |
58+
box install
59+
box install ${{ matrix.coldbox }} --noSave
60+
61+
- name: Restart server (so extensions are picked up)
62+
env:
63+
DB_HOST: localhost
64+
DB_PORT: ${{ job.services.postgres.ports[5432] }}
65+
DB_NAME: cfmigrations_testing
66+
DB_USER: cfmigrations_testing
67+
DB_PASSWORD: cfmigrations_testing
68+
run: |
69+
box server restart
70+
sleep 30
71+
72+
- name: Run TestBox Tests
73+
env:
74+
DB_HOST: localhost
75+
DB_PORT: ${{ job.services.postgres.ports[5432] }}
76+
DB_NAME: cfmigrations_testing
77+
DB_USER: cfmigrations_testing
78+
DB_PASSWORD: cfmigrations_testing
79+
run: box testbox run
80+
81+
# release:
82+
# name: Semantic Release
83+
# if: "!contains(github.event.head_commit.message, '__SEMANTIC RELEASE VERSION UPDATE__')"
84+
# needs: tests
85+
# runs-on: ubuntu-latest
86+
# env:
87+
# GA_COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
88+
# steps:
89+
# - name: Checkout Repository
90+
# uses: actions/checkout@v2
91+
# with:
92+
# fetch-depth: 0
93+
94+
# - name: Setup Java JDK
95+
# uses: actions/[email protected]
96+
# with:
97+
# java-version: 11
98+
99+
# - name: Set Up CommandBox
100+
# uses: elpete/[email protected]
101+
102+
# - name: Install and Configure Semantic Release
103+
# run: |
104+
# box install commandbox-semantic-release
105+
# box config set endpoints.forgebox.APIToken=${{ secrets.FORGEBOX_TOKEN }}
106+
# box config set modules.commandbox-semantic-release.plugins='{ "VerifyConditions": "GitHubActionsConditionsVerifier@commandbox-semantic-release", "FetchLastRelease": "ForgeBoxReleaseFetcher@commandbox-semantic-release", "RetrieveCommits": "JGitCommitsRetriever@commandbox-semantic-release", "ParseCommit": "ConventionalChangelogParser@commandbox-semantic-release", "FilterCommits": "DefaultCommitFilterer@commandbox-semantic-release", "AnalyzeCommits": "DefaultCommitAnalyzer@commandbox-semantic-release", "VerifyRelease": "NullReleaseVerifier@commandbox-semantic-release", "GenerateNotes": "GitHubMarkdownNotesGenerator@commandbox-semantic-release", "UpdateChangelog": "FileAppendChangelogUpdater@commandbox-semantic-release", "CommitArtifacts": "NullArtifactsCommitter@commandbox-semantic-release", "PublishRelease": "ForgeBoxReleasePublisher@commandbox-semantic-release", "PublicizeRelease": "GitHubReleasePublicizer@commandbox-semantic-release" }'
107+
108+
# - name: Run Semantic Release
109+
# env:
110+
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
# run: box semantic-release --prerelease

0 commit comments

Comments
 (0)