1- name : rTabby
1+ name : rust-build
22
33on :
44 push :
5- branches : [ "master" ]
6- tags : [ 'v*.*.*' ]
5+ branches : [ "master", "dev" ]
76 pull_request :
8- branches : [ "master" ]
7+ branches : [ "master", "dev" ]
98 release :
109 types : [published]
1110
1918jobs :
2019 build :
2120 name : Rust Build
22- runs-on : ubuntu-latest
21+ strategy :
22+ matrix :
23+ arch : [amd64, arm64]
24+ db : [mysql, sqlite]
25+ login : [local-users, oauth]
26+ include :
27+ # runson
28+ - arch : ' amd64'
29+ runson : ' ubuntu-22.04'
30+ - arch : ' arm64'
31+ runson : ' ubuntu-22.04-arm'
32+ # minimal build
33+ - login : ' local-users'
34+ minimal : true
35+ feature : ' '
36+ - login : ' oauth'
37+ minimal : false
38+ feature : ' -F all-login'
39+
40+ permissions :
41+ contents : read
42+
43+ runs-on : ${{ matrix.runson }}
2344 steps :
24- - uses : actions/checkout@v3
45+ - uses : actions/checkout@v4
46+
47+ - name : Install mysql build dependencies
48+ if : ${{ matrix.db == 'mysql' }}
49+ run : sudo apt install libtirpc-dev
50+
2551 - name : Build
26- run : cargo build --verbose
27- - name : Run tests
28- run : cargo test --verbose
52+ run : cargo build --verbose --release --target-dir ci-build --no-default-features -F ${{ matrix.db }}-bundle ${{ matrix.feature }}
53+
54+ - name : Upload build binary
55+ uses : actions/upload-artifact@v4
56+ with :
57+ name : ${{ matrix.arch }}-${{ matrix.db }}-${{ matrix.login }}-rtabby-web-api
58+ path : ci-build/release/rtabby-web-api
2959
3060 docker :
3161 strategy :
3262 matrix :
3363 db : [mysql, sqlite]
34- minimal : [true, false]
64+ login : [local-users, oauth]
65+ include :
66+ # minimal build
67+ - login : ' local-users'
68+ minimal : true
69+ feature : ' '
70+ - login : ' oauth'
71+ minimal : false
72+ feature : ' -F all-login'
3573 name : Docker
3674 if : ${{ always() && contains(join(needs.*.result, ','), 'success') }}
3775 needs : [build]
@@ -47,13 +85,23 @@ jobs:
4785 - name : Checkout repository
4886 uses : actions/checkout@v3
4987
88+ - name : Download amd64 binary
89+ uses : actions/download-artifact@v4
90+ with :
91+ name : amd64-${{ matrix.db }}-${{ matrix.login }}-rtabby-web-api
92+ path : binary/linux/amd64/rtabby-web-api
93+
94+ - name : Download arm64 binary
95+ uses : actions/download-artifact@v4
96+ with :
97+ name : arm64-${{ matrix.db }}-${{ matrix.login }}-rtabby-web-api
98+ path : binary/linux/arm64/rtabby-web-api
99+
50100 # Install the cosign tool except on PR
51101 # https://github.com/sigstore/cosign-installer
52102 - name : Install cosign
53103 if : ${{ github.event_name == 'release' }}
54- 55- with :
56- cosign-release : ' v2.2.4'
104+ 57105
58106 - name : Set up QEMU
59107 if : ${{ github.event_name == 'release' }}
@@ -113,7 +161,8 @@ jobs:
113161 uses : docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
114162 with :
115163 context : .
116- platforms : linux/amd64${{ github.event_name == 'release' && ',linux/arm64' || '' }}
164+ file : Dockerfile-ci
165+ platforms : linux/amd64,linux/arm64
117166 push : ${{ github.event_name == 'release' }}
118167 tags : ${{ steps.meta.outputs.tags }}
119168 labels : ${{ steps.meta.outputs.labels }}
@@ -136,4 +185,4 @@ jobs:
136185 DIGEST : ${{ steps.build-and-push.outputs.digest }}
137186 # This step uses the identity token to provision an ephemeral certificate
138187 # against the sigstore community Fulcio instance.
139- run : echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
188+ run : echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
0 commit comments