Skip to content

Commit

Permalink
test workflow config
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhao99 committed Dec 13, 2023
1 parent 03f934d commit adef024
Show file tree
Hide file tree
Showing 8 changed files with 727 additions and 729 deletions.
118 changes: 59 additions & 59 deletions .github/workflows/checkGraphql.yml
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
128 changes: 64 additions & 64 deletions .github/workflows/chromatic.yml
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
110 changes: 55 additions & 55 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: "45 4 * * 3"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
JAVA_VERSION: 17
JAVA_DISTRIBUTION: 'zulu'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ javascript, java ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{env.JAVA_VERSION}}
distribution: ${{env.JAVA_DISTRIBUTION}}

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
#name: "CodeQL"
#
#on:
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
# schedule:
# - cron: "45 4 * * 3"
#
#concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
# cancel-in-progress: true
#
#env:
# JAVA_VERSION: 17
# JAVA_DISTRIBUTION: 'zulu'
#
#jobs:
# analyze:
# name: Analyze
# runs-on: ubuntu-latest
# permissions:
# actions: read
# contents: read
# security-events: write
#
# strategy:
# fail-fast: false
# matrix:
# language: [ javascript, java ]
#
# steps:
# - name: Checkout
# uses: actions/checkout@v4
#
# - name: Initialize CodeQL
# uses: github/codeql-action/init@v2
# with:
# languages: ${{ matrix.language }}
# queries: +security-and-quality
#
# - name: Set up JDK
# uses: actions/setup-java@v4
# with:
# java-version: ${{env.JAVA_VERSION}}
# distribution: ${{env.JAVA_DISTRIBUTION}}
#
# - name: Autobuild
# uses: github/codeql-action/autobuild@v2
#
# - name: Perform CodeQL Analysis
# uses: github/codeql-action/analyze@v2
# with:
# category: "/language:${{ matrix.language }}"
Loading

0 comments on commit adef024

Please sign in to comment.