mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-08 08:12:48 +01:00
Compare commits
2 Commits
v0.10.0-rc
...
v0.10.0-rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fc42d4043b | ||
|
|
e987e46cbd |
119
.github/workflows/ci.yml
vendored
119
.github/workflows/ci.yml
vendored
@@ -13,25 +13,9 @@ jobs:
|
|||||||
name: Lint
|
name: Lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v3
|
|
||||||
with: { go-version: '1.18' }
|
|
||||||
|
|
||||||
- id: goenv
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=gocache::$(go env GOCACHE)"
|
|
||||||
echo "::set-output name=gomodcache::$(go env GOMODCACHE)"
|
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-go@v3
|
||||||
- uses: actions/cache@v3
|
with: { go-version: '1.19', cache: true }
|
||||||
with:
|
|
||||||
path: ${{ steps.goenv.outputs.gocache }}
|
|
||||||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ${{ steps.goenv.outputs.gomodcache }}
|
|
||||||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
|
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
mkdir -p ui/dist/img
|
mkdir -p ui/dist/img
|
||||||
touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png
|
touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png
|
||||||
@@ -40,29 +24,12 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env: { GIN_MODE: test }
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v3
|
|
||||||
with: { go-version: '1.18' }
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with: { node-version: '14' }
|
|
||||||
|
|
||||||
- id: goenv
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=gocache::$(go env GOCACHE)"
|
|
||||||
echo "::set-output name=gomodcache::$(go env GOMODCACHE)"
|
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
- uses: actions/cache@v3
|
with: { node-version: '14', cache: 'yarn', cache-dependency-path: 'ui/yarn.lock' }
|
||||||
with:
|
- uses: actions/setup-go@v3
|
||||||
path: ${{ steps.goenv.outputs.gocache }}
|
with: { go-version: '1.19', cache: true }
|
||||||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ${{ steps.goenv.outputs.gomodcache }}
|
|
||||||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
|
|
||||||
|
|
||||||
- run: |
|
- run: |
|
||||||
mkdir -p ui/dist/img
|
mkdir -p ui/dist/img
|
||||||
touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png
|
touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png
|
||||||
@@ -85,46 +52,29 @@ jobs:
|
|||||||
auth: [ keycloak ] # simple
|
auth: [ keycloak ] # simple
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- uses: actions/checkout@v3
|
||||||
uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-go@v3
|
- uses: actions/setup-go@v3
|
||||||
with: { go-version: '1.18' }
|
with: { go-version: '1.18' }
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with: { node-version: '14' }
|
with: { node-version: '14' }
|
||||||
|
|
||||||
# run UI
|
# run UI
|
||||||
- run: |
|
- run: |
|
||||||
yarn install
|
yarn install
|
||||||
yarn serve &
|
yarn serve &
|
||||||
working-directory: ui
|
working-directory: ui
|
||||||
- run: go install github.com/cugu/wait_for_response@latest
|
- run: curl --head -X GET --retry 60 --retry-connrefused --retry-delay 10 http://localhost:8080
|
||||||
- name: Wait for frontend
|
|
||||||
uses: cugu/wait_for_response@v1.13.0
|
|
||||||
with:
|
|
||||||
url: 'http://localhost:8080'
|
|
||||||
responseCode: 200
|
|
||||||
|
|
||||||
# run containers
|
# run containers
|
||||||
- run: |
|
- run: |
|
||||||
sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx.conf
|
sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx.conf
|
||||||
sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx-with-keycloak.conf
|
sed -i 's/host.docker.internal/172.17.0.1/g' dev/nginx-with-keycloak.conf
|
||||||
|
|
||||||
- run: docker compose up --quiet-pull --detach
|
- run: docker compose up --quiet-pull --detach
|
||||||
working-directory: dev
|
working-directory: dev
|
||||||
if: matrix.auth == 'simple'
|
if: matrix.auth == 'simple'
|
||||||
- run: docker compose -f docker-compose-with-keycloak.yml up --quiet-pull --detach
|
- run: docker compose -f docker-compose-with-keycloak.yml up --quiet-pull --detach
|
||||||
working-directory: dev
|
working-directory: dev
|
||||||
if: matrix.auth == 'keycloak'
|
if: matrix.auth == 'keycloak'
|
||||||
- name: Wait for keycloak
|
- run: curl --head -X GET --retry 60 --retry-connrefused --retry-delay 10 http://localhost:9002/auth/realms/catalyst
|
||||||
uses: cugu/wait_for_response@v1.13.0
|
|
||||||
with:
|
|
||||||
url: 'http://localhost:9002/auth/realms/catalyst'
|
|
||||||
responseCode: 200
|
|
||||||
verbose: true
|
|
||||||
timeout: 3m
|
|
||||||
interval: 10s
|
|
||||||
if: matrix.auth == 'keycloak'
|
if: matrix.auth == 'keycloak'
|
||||||
|
|
||||||
# run catalyst
|
# run catalyst
|
||||||
- run: |
|
- run: |
|
||||||
mkdir -p ui/dist/img
|
mkdir -p ui/dist/img
|
||||||
@@ -136,16 +86,7 @@ jobs:
|
|||||||
- run: bash start_dev_with_keycloak.sh &
|
- run: bash start_dev_with_keycloak.sh &
|
||||||
working-directory: dev
|
working-directory: dev
|
||||||
if: matrix.auth == 'keycloak'
|
if: matrix.auth == 'keycloak'
|
||||||
- name: Wait for catalyst
|
- run: curl --head -X GET --retry 60 --retry-connrefused --retry-delay 10 http://localhost:8000
|
||||||
uses: cugu/wait_for_response@v1.13.0
|
|
||||||
with:
|
|
||||||
url: 'http://localhost:8000'
|
|
||||||
method: GET
|
|
||||||
responseCode: 302
|
|
||||||
verbose: true
|
|
||||||
timeout: 3m
|
|
||||||
interval: 10s
|
|
||||||
|
|
||||||
# run cypress
|
# run cypress
|
||||||
- uses: cypress-io/github-action@v4
|
- uses: cypress-io/github-action@v4
|
||||||
env:
|
env:
|
||||||
@@ -165,15 +106,9 @@ jobs:
|
|||||||
name: Build npm
|
name: Build npm
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with: { node-version: '14' }
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-node@v3
|
||||||
- uses: actions/cache@v3
|
with: { node-version: '14', cache: 'yarn', cache-dependency-path: 'ui/yarn.lock' }
|
||||||
with:
|
|
||||||
path: '**/node_modules'
|
|
||||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
|
||||||
|
|
||||||
- run: yarn install && yarn build
|
- run: yarn install && yarn build
|
||||||
working-directory: ui
|
working-directory: ui
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
@@ -185,38 +120,22 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ build-npm, test ]
|
needs: [ build-npm, test ]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v3
|
|
||||||
with: { go-version: '1.18' }
|
|
||||||
|
|
||||||
- id: goenv
|
|
||||||
run: |
|
|
||||||
echo "::set-output name=gocache::$(go env GOCACHE)"
|
|
||||||
echo "::set-output name=gomodcache::$(go env GOMODCACHE)"
|
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-go@v3
|
||||||
- uses: actions/cache@v3
|
with: { go-version: '1.19', cache: true }
|
||||||
with:
|
|
||||||
path: ${{ steps.goenv.outputs.gocache }}
|
|
||||||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: ${{ steps.goenv.outputs.gomodcache }}
|
|
||||||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with: { name: ui, path: ui/dist }
|
with: { name: ui, path: ui/dist }
|
||||||
|
- name: Version
|
||||||
|
if: github.ref_type == 'tag' && github.ref_name != ''
|
||||||
|
run: |
|
||||||
|
echo ${{ github.ref_name }}
|
||||||
|
echo ${{ github.ref_name }} > VERSION
|
||||||
- run: go build -o catalyst ./cmd/catalyst/.
|
- run: go build -o catalyst ./cmd/catalyst/.
|
||||||
- uses: docker/login-action@v2
|
- uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY }}
|
registry: ${{ env.REGISTRY }}
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Version
|
|
||||||
if: github.ref_type == 'tag' && github.ref_name != ''
|
|
||||||
run: |
|
|
||||||
echo ${{ github.ref_name }}
|
|
||||||
echo ${{ github.ref_name }} > VERSION
|
|
||||||
- name: Extract metadata (tags, labels) for Docker
|
- name: Extract metadata (tags, labels) for Docker
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
|
|||||||
Reference in New Issue
Block a user