diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e2704f7..4bc0f72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,14 @@ -# DO NOT EDIT THIS FILE DIRECTLY! -# This is synced from the juno-fx/ci repository in the .microservice/workflows directory and should be modified there. -name: Microservice CI/CD +name: Microservice CI on: - push: - paths-ignore: - - '.github/**' - - 'crds/**' workflow_dispatch: workflow_call: + jobs: - ci: - uses: juno-fx/ci/.github/workflows/ms-ci.yml@main + QC: + uses: ./.github/workflows/ms-qc.yml + secrets: inherit + Test: + needs: + - QC + uses: ./.github/workflows/ms-test.yml secrets: inherit diff --git a/.github/workflows/ms-qc.yml b/.github/workflows/ms-qc.yml new file mode 100644 index 0000000..a59126d --- /dev/null +++ b/.github/workflows/ms-qc.yml @@ -0,0 +1,66 @@ +name: Quality Control +on: + workflow_dispatch: + workflow_call: + +jobs: + check: + name: Checking Code + env: + IN_CI: "true" + runs-on: + - STANDARD-RUNNER + steps: + # this is the bare minimum to get the runner up and running. + - name: Install Git + run: sudo apt update && sudo apt-get install git -y + + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.JUNO_CI_APP_ID }} + private-key: ${{ secrets.JUNO_CI_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + + - name: Clone Source Code + uses: actions/checkout@v4 + with: + submodules: 'true' + token: ${{ steps.generate-token.outputs.token }} + + - name: Install Actions + uses: actions/checkout@v4 + with: + repository: juno-fx/ci + ref: main + path: juno-ci + clean: false + token: ${{ steps.generate-token.outputs.token }} + + - uses: ./juno-ci/actions/runners/tooling + name: Prepare Runner + with: + key: ${{ secrets.AWS_ACCESS }} + secret: ${{ secrets.AWS_SECRET }} + region: ${{ secrets.AWS_REGION }} + + - name: Safety Devbox + run: | + # safety net for new runners who already ship with podman override for docker and kind. + devbox rm docker kind || echo "No docker or kind present. Good to go." + + - name: Check Code + shell: bash + env: + GH_TOKEN: ${{ secrets.GIT_PASS }} + IN_CI: "true" + run: | + if [ -z "$GH_TOKEN" ]; then + echo "Token missing" + exit 1 + else + echo "Token present" + fi + devbox run make install + devbox run make check diff --git a/.github/workflows/ms-test.yml b/.github/workflows/ms-test.yml new file mode 100644 index 0000000..d1a1875 --- /dev/null +++ b/.github/workflows/ms-test.yml @@ -0,0 +1,68 @@ +name: Testing +on: + workflow_dispatch: + workflow_call: + +jobs: + test: + name: Testing + env: + IN_CI: "true" + runs-on: + - STANDARD-RUNNER + steps: + # this is the bare minimum to get the runner up and running. + - name: Install Git + run: sudo apt update && sudo apt-get install git -y + + - name: Generate a token + id: generate-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ secrets.JUNO_CI_APP_ID }} + private-key: ${{ secrets.JUNO_CI_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + + - name: Clone Source Code + uses: actions/checkout@v4 + with: + submodules: 'true' + token: ${{ steps.generate-token.outputs.token }} + + - name: Install Actions + uses: actions/checkout@v4 + with: + repository: juno-fx/ci + ref: main + path: juno-ci + clean: false + token: ${{ steps.generate-token.outputs.token }} + + - uses: ./juno-ci/actions/runners/tooling + name: Prepare Runner + with: + key: ${{ secrets.AWS_ACCESS }} + secret: ${{ secrets.AWS_SECRET }} + region: ${{ secrets.AWS_REGION }} + + - name: Safety Devbox + run: | + # safety net for new runners who already ship with podman override for docker and kind. + devbox rm docker kind || echo "No docker or kind present. Good to go." + + - name: Run pnpm audit + env: + JUNO_LICENSE_TOKEN: ${{ secrets.JUNO_LICENSE_TOKEN }} + GH_TOKEN: ${{ secrets.GIT_PASS }} + IN_CI: "true" + if: contains(fromJSON('["juno-fx/hubble","juno-fx/genesis"]'), github.repository) + run: devbox run make audit + + - name: Run Tests + env: + JUNO_LICENSE_TOKEN: ${{ secrets.JUNO_LICENSE_TOKEN }} + GH_TOKEN: ${{ secrets.GIT_PASS }} + IN_CI: "true" + run: | + devbox run make down + devbox run make test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 388742c..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,41 +0,0 @@ -# DO NOT EDIT THIS FILE DIRECTLY! -# This is synced from the juno-fx/ci repository in the .microservice/workflows directory and should be modified there. -name: Microservice Tagged Release -on: - workflow_dispatch: - inputs: - bump: - type: choice - description: What to bump by. - default: patch - options: - - patch - - minor - - major -jobs: - StableReleaseProtection: - runs-on: - - self-hosted - steps: - - name: Fail of not on main - if: github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main' - run: | - echo "Not on main branch, exiting..." - exit 1 - QC: - needs: - - StableReleaseProtection - uses: juno-fx/ci/.github/workflows/ms-qc.yml@main - secrets: inherit - Test: - needs: - - QC - uses: juno-fx/ci/.github/workflows/ms-test.yml@main - secrets: inherit - Tag: - needs: - - Test - uses: juno-fx/ci/.github/workflows/bumpversion.yml@main - secrets: inherit - with: - bump: ${{ inputs.bump }} diff --git a/k8s/testservice/deployment.yaml b/k8s/testservice/deployment.yaml index e7ee572..fb352b4 100644 --- a/k8s/testservice/deployment.yaml +++ b/k8s/testservice/deployment.yaml @@ -20,7 +20,10 @@ spec: - containerPort: 3000 name: http - name: rhea - image: junoinnovations/rhea:unstable + image: junoinnovations/rhea:v1.0.0 + env: + - name: LOGLEVEL + value: debug ports: - containerPort: 13000 name: auth