Skip to content

Commit 6219e70

Browse files
authored
Merge branch 'main' into add-ldap-auth
2 parents 735e842 + 2019faf commit 6219e70

17 files changed

Lines changed: 384 additions & 118 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
mongodb-version: ${{ matrix.mongodb-version }}
4444

4545
- name: Install dependencies
46-
run: npm ci
46+
run: npm ci --no-fund
4747

4848
# for now only check the types of the server
4949
# tsconfig isn't quite set up right to respect what vite accepts
@@ -54,6 +54,11 @@ jobs:
5454
- name: Build TypeScript
5555
run: npm run build-ts
5656

57+
- name: Build CLI
58+
run: |
59+
npm run build -w @finos/git-proxy-cli
60+
npm rebuild @finos/git-proxy-cli
61+
5762
- name: Test
5863
id: test
5964
run: |
@@ -69,28 +74,17 @@ jobs:
6974
- name: Upload test coverage report
7075
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
7176
with:
72-
files: ./coverage/lcov.info
77+
files: ./coverage/lcov.info,./coverage-cli/lcov.info
7378
token: ${{ secrets.CODECOV_TOKEN }}
7479

7580
- name: Build frontend
7681
run: npm run build-ui
7782

78-
- name: Save build folder
79-
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
80-
with:
81-
name: build-ubuntu-node-${{ matrix.node-version }}-mongo-${{ matrix.mongodb-version }}
82-
if-no-files-found: error
83-
path: build
84-
85-
- name: Download the build folders
86-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8
87-
with:
88-
name: build-ubuntu-node-${{ matrix.node-version }}-mongo-${{ matrix.mongodb-version }}
89-
path: build
90-
9183
- name: Run cypress test
9284
uses: cypress-io/github-action@4c06c48f3ffea349b7189aa06dfcda47a9fa7b92 # v7.1.8
9385
with:
86+
# skip the action's internal npm ci — dependencies are already installed above
87+
install: false
9488
start: npm start &
9589
wait-on: 'http://localhost:3000'
9690
wait-on-timeout: 120
@@ -121,14 +115,19 @@ jobs:
121115
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
122116
123117
- name: Install dependencies
124-
run: npm ci
118+
run: npm ci --no-fund
125119

126120
- name: Check Types (Server)
127121
run: npm run check-types:server
128122

129123
- name: Build TypeScript
130124
run: npm run build-ts
131125

126+
- name: Build CLI
127+
run: |
128+
npm run build -w @finos/git-proxy-cli
129+
npm rebuild @finos/git-proxy-cli
130+
132131
- name: Test
133132
id: test
134133
shell: bash

.github/workflows/e2e.yml

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,23 @@ on:
1414
jobs:
1515
e2e:
1616
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
suite: [vitest, cypress]
20+
env:
21+
BUILDX_CACHE_SCOPE: ${{ matrix.suite }}-build
1722

1823
steps:
1924
- name: Checkout code
2025
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
2126

2227
- name: Set up Docker Buildx
2328
uses: docker/setup-buildx-action@d91f340399fb2345e3e45f5461e116862b08261d
29+
with:
30+
install: true
31+
32+
- name: Expose GitHub Runtime for Docker Cache
33+
uses: crazy-max/ghaction-github-runtime@3cb05d89e1f492524af3d41a1c98c83bc3025124 # v3
2434

2535
- name: Set up Docker Compose
2636
uses: docker/setup-compose-action@e29e0ecd235838be5f2e823f8f512a72dc55f662
@@ -41,18 +51,20 @@ jobs:
4151
git config --global init.defaultBranch main
4252
4353
- name: Build and start services with Docker Compose
44-
run: docker compose up -d --build --wait || true
54+
run: docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d --build --wait
4555

4656
- name: Debug service state
47-
if: always()
57+
if: failure()
4858
run: |
4959
docker compose ps
5060
docker compose logs
5161
52-
- name: Run E2E tests
62+
- name: Run vitest E2E tests
63+
if: matrix.suite == 'vitest'
5364
run: npm run test:e2e
5465

5566
- name: Run Cypress E2E tests
67+
if: matrix.suite == 'cypress'
5668
run: npm run cypress:run:docker
5769
timeout-minutes: 10
5870
env:
@@ -67,7 +79,7 @@ jobs:
6779

6880
- name: Upload Cypress screenshots on failure
6981
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7
70-
if: failure()
82+
if: failure() && matrix.suite == 'cypress'
7183
with:
7284
name: cypress-screenshots
7385
path: cypress/screenshots
@@ -76,3 +88,18 @@ jobs:
7688
- name: Stop services
7789
if: always()
7890
run: docker compose down -v
91+
92+
results:
93+
if: ${{ always() }}
94+
runs-on: ubuntu-latest
95+
name: e2e
96+
needs: [e2e]
97+
steps:
98+
- name: Check e2e results
99+
run: |
100+
result="${{ needs.e2e.result }}"
101+
if [[ "$result" == "success" || "$result" == "skipped" ]]; then
102+
exit 0
103+
else
104+
exit 1
105+
fi

.github/workflows/unused-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
node-version: '24.x'
2222
- name: 'Run depcheck'
2323
run: |
24-
npx depcheck --skip-missing --ignores="tsx,@babel/*,@commitlint/*,eslint,eslint-*,husky,ts-node,concurrently,nyc,prettier,typescript,tsconfig-paths,vite-tsconfig-paths,quicktype,history,@types/domutils,@vitest/coverage-v8,cross-env"
24+
npx depcheck --skip-missing --ignores="tsx,@babel/*,@commitlint/*,eslint,eslint-*,husky,ts-node,concurrently,nyc,prettier,typescript,tsconfig-paths,vite-tsconfig-paths,quicktype,history,@types/domutils,@vitest/coverage-v8,cross-env,c8"
2525
echo $?
2626
if [[ $? == 1 ]]; then
2727
echo "Unused dependencies or devDependencies found"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ dist
245245

246246
# testing
247247
/coverage
248+
/coverage-cli
248249

249250
# production
250251
/build

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ For detailed step-by-step instructions for how to install, deploy & configure Gi
8989
customize for your environment, see the [project's documentation](https://git-proxy.finos.org/docs/):
9090

9191
- [Quickstart](https://git-proxy.finos.org/docs/category/quickstart/)
92-
- [Installation](https://git-proxy.finos.org/docs/installation)
92+
- [Installation](https://git-proxy.finos.org/docs/quickstart/installation)
9393
- [Configuration](https://git-proxy.finos.org/docs/category/configuration)
9494
- [Contributing](https://git-proxy.finos.org/docs/development/contributing)
9595
- [Testing](https://git-proxy.finos.org/docs/development/testing)

docker-compose.ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
services:
2+
git-proxy:
3+
build:
4+
context: .
5+
cache_from:
6+
- type=gha
7+
cache_to:
8+
- type=gha,mode=max
9+
10+
git-server:
11+
build:
12+
context: localgit/
13+
cache_from:
14+
- type=gha
15+
cache_to:
16+
- type=gha,mode=max

0 commit comments

Comments
 (0)