-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (65 loc) · 2.16 KB
/
ci.yml
File metadata and controls
81 lines (65 loc) · 2.16 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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test-and-build:
name: Test and Build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup mvx
run: ./mvx setup
- name: Download dependencies
run: ./mvx go mod download
- name: Run tests
run: ./mvx test
- name: Run go vet
run: ./mvx go vet ./...
- name: Install golangci-lint
run: ./mvx install-golangci-lint
- name: Check formatting
run: |
GOROOT=$(./mvx go env GOROOT)
unformatted=$($GOROOT/bin/gofmt -s -l .)
if [ -n "$unformatted" ]; then
echo "The following files are not formatted:"
echo "$unformatted"
exit 1
fi
- name: Run integration tests
run: ./mvx test-integration
- name: Run benchmarks
run: ./mvx benchmark
- name: Build for all platforms
run: ./mvx build-all
- name: Generate checksums
run: ./mvx checksums
- name: Test wrapper functionality
run: |
# Test that wrapper works with current version
./mvx version
- name: Check website build
run: |
OWNER=$(echo "$GITHUB_REPOSITORY" | cut -d '/' -f 1)
REPO=$(echo "$GITHUB_REPOSITORY" | cut -d '/' -f 2)
SITE_URL="https://${OWNER}.github.io"
SITE_PATH="/${REPO}/"
echo "SITE_URL=$SITE_URL" >> $GITHUB_ENV
echo "SITE_PATH=$SITE_PATH" >> $GITHUB_ENV
echo "GITHUB_REPOSITORY=$GITHUB_REPOSITORY SITE_DIR=$SITE_DIR SITE_URL=$SITE_URL SITE_PATH=$SITE_PATH"
# Build website to catch template syntax errors
QUARKUS_ROQ_GENERATOR_BATCH=true ./mvx mvn clean package quarkus:run -f website -DskipTests --no-transfer-progress \
-Dquarkus.http.root-path=$SITE_PATH \
-Dsite.url=$SITE_URL
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: mvx-binaries
path: |
dist/mvx-*
dist/checksums.txt
retention-days: 7