Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add integration checks action #75

Merged
merged 80 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
4db4c82
initial setup
tsirlucas Jan 22, 2025
864cfcb
fix action path
tsirlucas Jan 22, 2025
49cd606
fix run
tsirlucas Jan 22, 2025
5093bc1
fix credentials
tsirlucas Jan 22, 2025
9763c6d
add update services.json
tsirlucas Jan 22, 2025
a3a0617
fix node version
tsirlucas Jan 22, 2025
0321838
bundle action code
tsirlucas Jan 22, 2025
ee0095a
use ts
tsirlucas Jan 22, 2025
ff65f56
fix services.json path
tsirlucas Jan 22, 2025
6712500
fix dir
tsirlucas Jan 22, 2025
4937d2a
build
tsirlucas Jan 22, 2025
a0940c1
fix path
tsirlucas Jan 22, 2025
4b38555
build
tsirlucas Jan 22, 2025
c9e13d6
check backend input
tsirlucas Jan 22, 2025
2c531e2
fix input
tsirlucas Jan 22, 2025
69c03a6
update services.json
tsirlucas Jan 22, 2025
8c6175c
adjust script for better logging
tsirlucas Jan 23, 2025
7cb64ea
adjust input
tsirlucas Jan 23, 2025
d6d6b09
load and generate code
tsirlucas Jan 23, 2025
e59b4d5
fix shell
tsirlucas Jan 23, 2025
7236c7c
fix empty input case
tsirlucas Jan 23, 2025
0e3babd
skip invalid semver
tsirlucas Jan 23, 2025
f48043f
add update docs json
tsirlucas Jan 23, 2025
13cbf20
log inputVersion
tsirlucas Jan 23, 2025
7688b5e
build
tsirlucas Jan 23, 2025
067714b
fixes reading json
tsirlucas Jan 23, 2025
0907c40
get api-client path
tsirlucas Jan 23, 2025
736aa81
add run-checks
tsirlucas Jan 23, 2025
747e019
rename be actions
tsirlucas Jan 23, 2025
d7597ea
fix path
tsirlucas Jan 23, 2025
d76f449
fix repo
tsirlucas Jan 23, 2025
3c23e33
build
tsirlucas Jan 23, 2025
fcaf543
cd into api-client-source
tsirlucas Jan 23, 2025
46eccc2
fixes on directories
tsirlucas Jan 23, 2025
15ab5c8
use working-directory instead of cding
tsirlucas Jan 23, 2025
3aa9c29
consider checkout_path on cache key
tsirlucas Jan 23, 2025
dfea039
use working-directory when calling yarn install
tsirlucas Jan 23, 2025
9a25d10
cd out of each repo by end of loop
tsirlucas Jan 23, 2025
69f2d8f
use ssh url on repository
tsirlucas Jan 23, 2025
9ef44fd
cache all yarn caches in repo
tsirlucas Jan 23, 2025
0d00467
build
tsirlucas Jan 23, 2025
174416b
try different git auth approach
tsirlucas Jan 23, 2025
1a78703
remove token as env var
tsirlucas Jan 23, 2025
f92d690
change username to srebot
tsirlucas Jan 23, 2025
6399478
safer logs on error
tsirlucas Jan 23, 2025
53bced4
better logging on git clone
tsirlucas Jan 23, 2025
6071b3d
build
tsirlucas Jan 23, 2025
8cba48d
use cwd
tsirlucas Jan 23, 2025
06a5e29
remove errStream param
tsirlucas Jan 23, 2025
beb3f13
log error
tsirlucas Jan 23, 2025
a538b21
correct runCheck dir
tsirlucas Jan 23, 2025
52c0a67
replace api-client instead of installing in monorepo
tsirlucas Jan 23, 2025
db9f7fa
force rm
tsirlucas Jan 23, 2025
dac656d
copy recursively
tsirlucas Jan 23, 2025
74de5ea
fix cache paths
tsirlucas Jan 23, 2025
15e07e9
fix paths
tsirlucas Jan 23, 2025
8f998b9
add checkout_path default value
tsirlucas Jan 23, 2025
21dd8ed
handle json file instead of content
tsirlucas Jan 23, 2025
bae1b85
better caching
tsirlucas Jan 23, 2025
bf10679
fix dep
tsirlucas Jan 23, 2025
32f9b8c
fix glob
tsirlucas Jan 23, 2025
c6f1548
fix copy
tsirlucas Jan 23, 2025
397f0d8
remove failed cache approach
tsirlucas Jan 23, 2025
e06fa55
add chilical
tsirlucas Jan 23, 2025
92f5a64
avoid failing on std error when running checks
tsirlucas Jan 23, 2025
a081b76
send errors to stdout instead
tsirlucas Jan 23, 2025
71a35fa
build
tsirlucas Jan 23, 2025
17ba663
fix stderr
tsirlucas Jan 23, 2025
4383a89
add npm_token param
tsirlucas Jan 23, 2025
f4c9ea0
remove comma
tsirlucas Jan 23, 2025
cfac5a7
add logs
tsirlucas Jan 23, 2025
8b72470
remove failOnStdErr
tsirlucas Jan 23, 2025
6ca4b4b
remove failOnStdErr
tsirlucas Jan 23, 2025
37ba7cd
change install order
tsirlucas Jan 23, 2025
00ffcf5
use resolutions to force api-client version
tsirlucas Jan 23, 2025
c374353
fix cwd
tsirlucas Jan 23, 2025
6cf5b66
try without manually adding api-client
tsirlucas Jan 24, 2025
e5f84f7
set outputs and log groups
tsirlucas Jan 24, 2025
d55e75e
adjust log groups
tsirlucas Jan 24, 2025
9c1e810
prepare for merging
tsirlucas Jan 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/actions/frontend-repo-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
checkout_path:
description: "Relative path under $GITHUB_WORKSPACE to place the repository"
required: false
default: "."
checkout_token:
description: "Github Token for when checking out a different repository"
required: false
outputs:
LATEST_TAG:
description: "Latest tag"
Expand All @@ -40,10 +44,10 @@ runs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
token: ${{ env.GITHUB_TOKEN }}
token: ${{ inputs.checkout_token || env.GITHUB_TOKEN }}
fetch-depth: ${{ inputs.fetch-depth }}
repository: ${{ inputs.checkout_repo }}
path: ${{ inputs.checkout-path }}
path: ${{ inputs.checkout_path }}

- name: Cache node_modules
uses: actions/cache@v4
Expand All @@ -53,12 +57,12 @@ runs:
cache-fingerprint: ${{ env.node-version }}-${{ hashFiles('**/yarn.lock') }}
with:
path: |
**/node_modules
${{ inputs.checkout_path }}/**/node_modules
!**/node_modules/.cache/turbo
.yarn/cache
${{ inputs.checkout_path }}/.yarn/cache
/home/runner/.cache/Cypress
key: v4-${{ runner.os }}-${{ env.cache-name }}-${{ env.cache-fingerprint }}
restore-keys: v4-${{ runner.os }}-${{ env.cache-name }}-
key: v4-${{ runner.os }}-${{ env.cache-name }}-${{ inputs.checkout_path }}-${{ env.cache-fingerprint }}
restore-keys: v4-${{ runner.os }}-${{ env.cache-name }}-${{ inputs.checkout_path }}-

- name: NPM auth
if: ${{ inputs.npm_token }}
Expand All @@ -76,6 +80,7 @@ runs:

- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
working-directory: ${{ inputs.checkout_path }}
run: yarn --immutable
shell: bash

Expand Down
72 changes: 72 additions & 0 deletions .github/actions/integration-checks/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: "Integration Checks"
description: "Checks for FE <-> BE Integration"
inputs:
frontend:
description: "Frontend apps versions"
required: false
backend:
description: "Backend services versions"
required: false
gcloud_credentials_json:
description: "GCLOUD credentials"
required: true
checkout_token:
description: "Github Token"
required: true
npm_token:
description: "NPM Token"
required: true
outputs:
failed_frontends:
description: "If it fails, outputs list of failed frontends"
value: ${{ steps.run-checks.outputs.failed_frontends }}
runs:
using: "composite"
steps:
- name: Setup
uses: Chili-Piper/frontend-actions/.github/actions/frontend-repo-setup@main
with:
checkout_path: api-client-source
checkout_repo: Chili-Piper/frontend
checkout_token: ${{ inputs.checkout_token }}
npm_token: ${{ inputs.npm_token }}
- name: Authenticate to CPCLOUD
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ inputs.gcloud_credentials_json }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Update api-client services.json
uses: Chili-Piper/frontend-actions/.github/actions/integration-checks/set-be-services@main
with:
api_client_source_path: api-client-source
backend: ${{ inputs.backend }}
- name: Load Open API Docs
shell: bash
working-directory: api-client-source
run: yarn workspace @chilipiper/api-client load-docs
- name: Update api-client docs json
uses: Chili-Piper/frontend-actions/.github/actions/integration-checks/set-be-openapi@main
with:
api_client_source_path: api-client-source
backend: ${{ inputs.backend }}
- name: Build API code
shell: bash
working-directory: api-client-source
run: yarn workspace @chilipiper/api-client generate-code
- name: Get api-client path
id: get-api-client-path
working-directory: api-client-source
run: |
FULL_PATH=$(realpath .)
echo "Full path: $FULL_PATH"

echo "api_client_repo_path=$FULL_PATH" > $GITHUB_OUTPUT
shell: bash
- name: Run Checks
id: run-checks
uses: Chili-Piper/frontend-actions/.github/actions/integration-checks/run-checks@main
with:
frontend: ${{ inputs.frontend }}
api_client_path: ${{ steps.get-api-client-path.outputs.api_client_repo_path }}/frontend-packages/api-client
checkout_token: ${{ inputs.checkout_token }}
18 changes: 18 additions & 0 deletions .github/actions/integration-checks/run-checks/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Run api-client checks"
description: "For each frontend repository, it will run typescript checks with specific versions of api-client"
inputs:
checkout_token:
description: "GH token used for checking out repositories"
required: true
api_client_path:
description: "Absolute path to api-client with specific BE services versions"
required: true
frontend:
description: "frontend apps versions"
required: false
outputs:
failed_frontends:
description: "If it fails, outputs list of failed frontends"
runs:
using: "node20"
main: "dist/index.js"
Loading