-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,041 additions
and
1,038 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
name: Check for Changes | ||
# Reusable workflow, compatible with push and pull_request events | ||
on: | ||
workflow_call: | ||
inputs: | ||
# can be a file or a folder | ||
what_to_check: | ||
required: true | ||
type: string | ||
outputs: | ||
has_changes: | ||
description: true or false string | ||
value: ${{ jobs.check_for_changes.outputs.has_changes }} | ||
jobs: | ||
check_for_changes: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
has_changes: ${{ steps.check_for_changes.outputs.has_changes }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- shell: bash | ||
id: check_for_changes | ||
run: | | ||
echo "::group::Set has_changes output" | ||
diff=$(git diff-tree --no-commit-id --name-only -r "origin/main" HEAD -- "${{ inputs.what_to_check }}") | ||
echo "Diff: $diff" | ||
diff_length=$(echo ${#diff}) | ||
has_diff=$([ $diff_length -gt 0 ] && echo "true" || echo "false") | ||
echo "The Changes: ${has_diff}" | ||
echo "has_changes=${has_diff}" >> "$GITHUB_OUTPUT" | ||
echo "::endgroup::" | ||
#name: Check for Changes | ||
## Reusable workflow, compatible with push and pull_request events | ||
#on: | ||
# workflow_call: | ||
# inputs: | ||
# # can be a file or a folder | ||
# what_to_check: | ||
# required: true | ||
# type: string | ||
# outputs: | ||
# has_changes: | ||
# description: true or false string | ||
# value: ${{ jobs.check_for_changes.outputs.has_changes }} | ||
#jobs: | ||
# check_for_changes: | ||
# runs-on: ubuntu-latest | ||
# outputs: | ||
# has_changes: ${{ steps.check_for_changes.outputs.has_changes }} | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# fetch-depth: 0 | ||
# - shell: bash | ||
# id: check_for_changes | ||
# run: | | ||
# echo "::group::Set has_changes output" | ||
# diff=$(git diff-tree --no-commit-id --name-only -r "origin/main" HEAD -- "${{ inputs.what_to_check }}") | ||
# echo "Diff: $diff" | ||
# diff_length=$(echo ${#diff}) | ||
# has_diff=$([ $diff_length -gt 0 ] && echo "true" || echo "false") | ||
# echo "The Changes: ${has_diff}" | ||
# echo "has_changes=${has_diff}" >> "$GITHUB_OUTPUT" | ||
# echo "::endgroup::" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,59 @@ | ||
name: Check Graphql | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- "**" | ||
merge_group: | ||
types: | ||
- checks_requested | ||
push: | ||
branches: | ||
- main | ||
|
||
env: | ||
NODE_VERSION: 18 | ||
|
||
defaults: | ||
run: | ||
working-directory: frontend | ||
|
||
jobs: | ||
check-graphql-types: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{env.NODE_VERSION}} | ||
uses: actions/[email protected] | ||
with: | ||
node-version: ${{env.NODE_VERSION}} | ||
- name: Cache yarn | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.cache/yarn | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Node setup | ||
run: yarn install --prefer-offline | ||
- name: Generate grahpql types | ||
run: yarn codegen | ||
- name: Lint generated files | ||
run: yarn lint:write | ||
- name: Check for changes | ||
run: | | ||
if [[ -z "$(git status --porcelain)" ]]; then | ||
exit 0 | ||
else | ||
echo "Current generated code does not match code in latest commit. try running cd frontend/ && yarn codegen" | ||
git diff >> diff.txt | ||
exit 1 | ||
fi | ||
- name: Archive git diff | ||
uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: files changed | ||
path: frontend/diff.txt | ||
retention-days: 7 | ||
#name: Check Graphql | ||
# | ||
#on: | ||
# workflow_dispatch: | ||
# pull_request: | ||
# branches: | ||
# - "**" | ||
# merge_group: | ||
# types: | ||
# - checks_requested | ||
# push: | ||
# branches: | ||
# - main | ||
# | ||
#env: | ||
# NODE_VERSION: 18 | ||
# | ||
#defaults: | ||
# run: | ||
# working-directory: frontend | ||
# | ||
#jobs: | ||
# check-graphql-types: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - name: Use Node.js ${{env.NODE_VERSION}} | ||
# uses: actions/[email protected] | ||
# with: | ||
# node-version: ${{env.NODE_VERSION}} | ||
# - name: Cache yarn | ||
# uses: actions/[email protected] | ||
# with: | ||
# path: ~/.cache/yarn | ||
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-yarn- | ||
# - name: Node setup | ||
# run: yarn install --prefer-offline | ||
# - name: Generate grahpql types | ||
# run: yarn codegen | ||
# - name: Lint generated files | ||
# run: yarn lint:write | ||
# - name: Check for changes | ||
# run: | | ||
# if [[ -z "$(git status --porcelain)" ]]; then | ||
# exit 0 | ||
# else | ||
# echo "Current generated code does not match code in latest commit. try running cd frontend/ && yarn codegen" | ||
# git diff >> diff.txt | ||
# exit 1 | ||
# fi | ||
# - name: Archive git diff | ||
# uses: actions/upload-artifact@v3 | ||
# if: failure() | ||
# with: | ||
# name: files changed | ||
# path: frontend/diff.txt | ||
# retention-days: 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,64 @@ | ||
name: Chromatic | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: | ||
- "**" | ||
paths: | ||
- "frontend/**" | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "frontend/**" | ||
|
||
env: | ||
NODE_VERSION: 18 | ||
|
||
jobs: | ||
chromatic-deployment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Chromatic wants the history | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Install dependencies | ||
run: yarn | ||
working-directory: frontend | ||
|
||
- name: Publish to Chromatic | ||
if: github.ref != 'refs/heads/main' | ||
uses: chromaui/action@v10 | ||
with: | ||
workingDir: frontend | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
ignoreLastBuildOnBranch: "**" # Better comparisons after rebasing | ||
exitZeroOnChanges: true | ||
exitOnceUploaded: true | ||
|
||
- name: Publish to Chromatic (auto-accept changes on merge main) | ||
if: github.ref == 'refs/heads/main' | ||
uses: chromaui/action@v10 | ||
with: | ||
workingDir: frontend | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
ignoreLastBuildOnBranch: "**" | ||
exitZeroOnChanges: true | ||
exitOnceUploaded: true | ||
autoAcceptChanges: true # handle squash-on-merge | ||
|
||
- name: Artifact Chromatic logs | ||
if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: logs | ||
path: frontend/*.log | ||
#name: Chromatic | ||
# | ||
#on: | ||
# workflow_dispatch: | ||
# pull_request: | ||
# branches: | ||
# - "**" | ||
# paths: | ||
# - "frontend/**" | ||
# push: | ||
# branches: | ||
# - main | ||
# paths: | ||
# - "frontend/**" | ||
# | ||
#env: | ||
# NODE_VERSION: 18 | ||
# | ||
#jobs: | ||
# chromatic-deployment: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# | ||
# - uses: actions/checkout@v4 | ||
# with: | ||
# fetch-depth: 0 # Chromatic wants the history | ||
# | ||
# - uses: actions/[email protected] | ||
# with: | ||
# node-version: ${{ env.NODE_VERSION }} | ||
# | ||
# - name: Install dependencies | ||
# run: yarn | ||
# working-directory: frontend | ||
# | ||
# - name: Publish to Chromatic | ||
# if: github.ref != 'refs/heads/main' | ||
# uses: chromaui/action@v10 | ||
# with: | ||
# workingDir: frontend | ||
# token: ${{ secrets.GITHUB_TOKEN }} | ||
# projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
# ignoreLastBuildOnBranch: "**" # Better comparisons after rebasing | ||
# exitZeroOnChanges: true | ||
# exitOnceUploaded: true | ||
# | ||
# - name: Publish to Chromatic (auto-accept changes on merge main) | ||
# if: github.ref == 'refs/heads/main' | ||
# uses: chromaui/action@v10 | ||
# with: | ||
# workingDir: frontend | ||
# token: ${{ secrets.GITHUB_TOKEN }} | ||
# projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
# ignoreLastBuildOnBranch: "**" | ||
# exitZeroOnChanges: true | ||
# exitOnceUploaded: true | ||
# autoAcceptChanges: true # handle squash-on-merge | ||
# | ||
# - name: Artifact Chromatic logs | ||
# if: failure() | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: logs | ||
# path: frontend/*.log |
Oops, something went wrong.