-
Notifications
You must be signed in to change notification settings - Fork 27
131 lines (114 loc) · 3.89 KB
/
nightly.yml
File metadata and controls
131 lines (114 loc) · 3.89 KB
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
124
125
126
127
128
129
130
131
name: Nightly Release & Integration Tests
on:
schedule:
# Every day at 02:00 UTC
- cron: '0 2 * * *'
workflow_dispatch: # Allow manual trigger
permissions:
contents: write
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
mendix-version: ['10.24.19.104498', '11.6.6', '11.10.0']
fail-fast: false
name: test (Mendix ${{ matrix.mendix-version }})
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.26'
- name: Cache ANTLR4 JAR
uses: actions/cache@v5
with:
path: ~/.m2/repository/org/antlr/antlr4
key: antlr4-4.13.2
- name: Install ANTLR4
run: pip install 'antlr4-tools==0.2.2'
- name: Generate parser
run: make grammar
env:
ANTLR4_TOOLS_ANTLR_VERSION: '4.13.2'
- name: Build
run: make build
- name: Unit tests
run: make test
- name: Setup mxbuild ${{ matrix.mendix-version }}
run: ./bin/mxcli setup mxbuild --version ${{ matrix.mendix-version }}
- name: Integration tests (Mendix ${{ matrix.mendix-version }})
run: make test-integration
timeout-minutes: 30
nightly:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-go@v6
with:
go-version: '1.26'
- uses: oven-sh/setup-bun@v2
- name: Cache ANTLR4 JAR
uses: actions/cache@v5
with:
path: ~/.m2/repository/org/antlr/antlr4
key: antlr4-4.13.2
- name: Install ANTLR4
run: pip install 'antlr4-tools==0.2.2'
- name: Generate parser
run: make grammar
env:
ANTLR4_TOOLS_ANTLR_VERSION: '4.13.2'
- name: Check for new commits since last nightly
id: check
run: |
LAST_NIGHTLY=$(gh release view nightly --json publishedAt -q .publishedAt 2>/dev/null || echo "")
if [ -n "$LAST_NIGHTLY" ]; then
COMMITS=$(git log --since="$LAST_NIGHTLY" --oneline origin/main | wc -l)
if [ "$COMMITS" -eq 0 ]; then
echo "No new commits since last nightly, skipping."
echo "skip=true" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "$COMMITS new commit(s) since last nightly."
fi
echo "skip=false" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ github.token }}
- name: Build release binaries
if: steps.check.outputs.skip != 'true'
run: VERSION=nightly-$(date -u +%Y%m%d)-$(git rev-parse --short HEAD) make release
- name: Generate changelog
if: steps.check.outputs.skip != 'true'
id: changelog
run: |
{
echo "body<<NIGHTLY_EOF"
echo "**Nightly build from \`main\` — $(date -u +%Y-%m-%d)**"
echo ""
echo "Commit: [\`$(git rev-parse --short HEAD)\`](https://github.com/${{ github.repository }}/commit/$(git rev-parse HEAD))"
echo ""
echo "### Recent changes"
echo ""
git log --oneline -20 origin/main
echo ""
echo "> This is an automated pre-release build. Use tagged releases for production."
echo "NIGHTLY_EOF"
} >> "$GITHUB_OUTPUT"
- name: Delete previous nightly release
if: steps.check.outputs.skip != 'true'
run: gh release delete nightly --cleanup-tag -y 2>/dev/null || true
env:
GH_TOKEN: ${{ github.token }}
- name: Create nightly release
if: steps.check.outputs.skip != 'true'
run: |
gh release create nightly \
--prerelease \
--title "Nightly $(date -u +%Y-%m-%d)" \
--notes "${{ steps.changelog.outputs.body }}" \
bin/mxcli-*
env:
GH_TOKEN: ${{ github.token }}