-
Notifications
You must be signed in to change notification settings - Fork 11
123 lines (115 loc) · 4.2 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Lucee data provider CI
on: [push, pull_request,workflow_dispatch]
jobs:
javabuild:
name: Java build
runs-on: ubuntu-latest
env:
luceeVersion: 6.0.3.1
#luceeVersionQuery: 6.0.3/all/jar
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Cache Maven packages
if: always()
uses: actions/cache@v4
with:
path: ~/.m2
key: lucee-script-runner-maven-cache
- name: Cache Test Artifacts
if: always()
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/tests/artifacts
key: test-artifacts
- name: Cache Lucee files
uses: actions/cache@v4
if: always()
with:
path: /home/runner/work/_actions/lucee/script-runner/main/lucee-download-cache
key: lucee-downloads
- name: Compile CFML
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}
luceeVersion: ${{ env.luceeVersion }}
#luceeVersionQuery: ${{ env.luceeVersionQuery }}
execute: /compile.cfm
compile: true
- name: Checkout Lucee
uses: actions/checkout@v4
with:
repository: lucee/lucee
path: lucee
- name: Run Lucee Test Suite (testLabels="data-provider")
uses: lucee/script-runner@main
with:
webroot: ${{ github.workspace }}/lucee/test
execute: /bootstrap-tests.cfm
luceeVersion: ${{ env.luceeVersion }}
#luceeVersionQuery: ${{ env.luceeVersionQuery }}
extensionDir: ${{ github.workspace }}/
env:
testLabels: data-provider
testAdditional: ${{ github.workspace }}/tests
testSevices: mysql
LUCEE_ADMIN_ENABLED: false
- name: Run Lucee Test Suite (testLabels="data-provider-integration") (expected to fail)
uses: lucee/script-runner@main
continue-on-error: true
with:
webroot: ${{ github.workspace }}/lucee/test
execute: /bootstrap-tests.cfm
luceeVersion: ${{ env.luceeVersion }}
#luceeVersionQuery: ${{ env.luceeVersionQuery }}
extensionDir: ${{ github.workspace }}/
env:
testLabels: data-provider-integration
testAdditional: ${{ github.workspace }}/tests
testSevices: mysql
LUCEE_ADMIN_ENABLED: false
build:
name: Docker build & publish
runs-on: ubuntu-latest
needs: [javabuild]
if: "github.ref == 'refs/heads/main' && github.event_name == 'push'"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Create Docker Buildx builder
run: |
docker buildx create --name lucee_builder
docker buildx inspect lucee_builder --bootstrap
- name: Push to docker
run: |
docker buildx build --platform linux/amd64,linux/arm64 --build-arg SENTRY_ENV=UAT --build-arg SENTRY_DSN=:${{ env.SENTRY_DSN }} -t markdrew/lucee-downloads:latest -t markdrew/lucee-downloads:${{ github.sha }} -f devops/Dockerfile.download . --push
docker buildx build --platform linux/amd64,linux/arm64 --build-arg SENTRY_ENV=UAT --build-arg SENTRY_DSN=:${{ env.SENTRY_DSN }} -t markdrew/lucee-update:latest -t markdrew/lucee-update:${{ github.sha }} -f devops/Dockerfile.update . --push
deploy-to-update:
name: Deploy to update.lucee.org
runs-on: ubuntu-latest
needs: [build]
environment:
name: productiondeploy
steps:
- name: Deploy to update.lucee.org
run: curl -XPOST -u ${{ secrets.DEPLOY_API_TOKEN }}:${{ secrets.DEPLOY_API_TOKEN }} "${{ secrets.DEPLOY_API_ENDPOINT }}/update/"
deploy-to-downloads:
name: Deploy to download.lucee.org
runs-on: ubuntu-latest
needs: [build]
environment:
name: productiondeploy
steps:
- name: Deploy to downloads.lucee.org
run: curl -XPOST -u ${{ secrets.DEPLOY_API_TOKEN }}:${{ secrets.DEPLOY_API_TOKEN }} "${{ secrets.DEPLOY_API_ENDPOINT }}/download/"