ref: Update TOS to work for service less users. #292
Workflow file for this run
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
name: Gazebo CI | |
on: | |
push: | |
branches: | |
- main | |
- staging | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
total-runners: 6 | |
jobs: | |
install: | |
name: Install deps | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.8.0' | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-gazebo-node-modules | |
with: | |
path: | | |
node_modules | |
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.cache-name }}- | |
- name: Setup Bun | |
uses: oven-sh/setup-bun@v1 | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
- name: Install packages | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
bun install | |
lint: | |
name: Run Lint | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.8.0' | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-gazebo-node-modules | |
with: | |
path: | | |
node_modules | |
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.cache-name }}- | |
- name: Run linter | |
run: | | |
npm run lint | |
type-check: | |
name: Run Type Checker | |
runs-on: ubuntu-latest | |
needs: install | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.8.0' | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-gazebo-node-modules | |
with: | |
path: | | |
node_modules | |
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.cache-name }}- | |
- name: Run TSC | |
run: | | |
npm run type-check | |
codecovstartup: | |
name: Codecov Startup | |
needs: install | |
uses: codecov/gha-workflows/.github/workflows/[email protected] | |
secrets: inherit | |
runner-indexes: | |
runs-on: ubuntu-latest | |
name: Generate runner indexes | |
needs: install | |
outputs: | |
json: ${{ steps.generate-index-list.outputs.json }} | |
steps: | |
- name: Generate test index list | |
id: generate-index-list | |
run: | | |
MAX_INDEX=$((${{ env.total-runners }}-1)) | |
INDEX_LIST=$(seq 0 ${MAX_INDEX}) | |
INDEX_JSON=$(jq --null-input --compact-output '. |= [inputs]' <<< ${INDEX_LIST}) | |
echo "::set-output name=json::${INDEX_JSON}" | |
test: | |
name: 'Test Runner #${{ matrix.runner-index }}' | |
needs: [install, codecovstartup, runner-indexes] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
runner-index: ${{ fromjson(needs.runner-indexes.outputs.json) }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.8.0' | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-gazebo-node-modules | |
with: | |
path: | | |
node_modules | |
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.cache-name }}- | |
- name: Split tests | |
uses: chaosaffe/[email protected] | |
id: split-tests | |
with: | |
glob: '"src/**/*.spec.js" "src/**/*.test.js" "src/**/*.spec.jsx" "src/**/*.test.jsx" "src/**/*.spec.ts" "src/**/*.test.ts" "src/**/*.spec.tsx" "src/**/*.test.tsx"' | |
split-total: ${{ env.total-runners }} | |
split-index: ${{ matrix.runner-index }} | |
- name: Bring test env up | |
run: | | |
CI=true npm run test:ci -- --maxWorkers=2 ${{ steps.split-tests.outputs.test-suite }} | |
env: | |
JEST_JUNIT_OUTPUT_DIR: ./reports/junit/ | |
- name: Install CLI | |
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} | |
run: | | |
make test_env.install_cli | |
## Don't upload on forks for now. | |
- name: Upload to Production | |
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} | |
run: | | |
codecovcli do-upload -t ${{ secrets.CODECOV_ORG_TOKEN }} --fail-on-error | |
- name: Upload to Staging | |
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} | |
run: | | |
codecovcli -u ${{ secrets.CODECOV_STAGING_URL }} do-upload -t ${{ secrets.CODECOV_ORG_TOKEN_STAGING }} --fail-on-error | |
- name: Upload to QA | |
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} | |
run: | | |
codecovcli -u ${{ secrets.CODECOV_QA_URL }} do-upload -t ${{ secrets.CODECOV_QA_TOKEN }} --fail-on-error | |
- name: Upload to Public QA | |
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} | |
run: | | |
codecovcli -u ${{ secrets.CODECOV_PUBLIC_QA_URL }} do-upload -t ${{ secrets.CODECOV_PUBLIC_QA_TOKEN }} --fail-on-error | |
storybook: | |
name: Run storybook | |
runs-on: ubuntu-latest | |
needs: install | |
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.ref, 'refs/heads/dependabot') && github.repository_owner == 'codecov' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.8.0' | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-gazebo-node-modules | |
with: | |
path: | | |
node_modules | |
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.cache-name }}- | |
- name: Deploy to Chromatic | |
run: | | |
npm run chromatic | |
env: | |
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | |
fossa: | |
name: Run Fossa | |
runs-on: ubuntu-latest | |
needs: install | |
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.8.0' | |
- name: Run Fossa | |
uses: fossas/[email protected] | |
with: | |
api-key: ${{secrets.FOSSA_API_KEY}} | |
build: | |
name: Build App | |
runs-on: ubuntu-latest | |
needs: [install, test] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.8.0' | |
- name: Cache node_modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-gazebo-node-modules | |
with: | |
path: | | |
node_modules | |
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.cache-name }}- | |
- name: Build React App | |
if: ${{ steps.cache-node-modules.outputs.cache-hit != 'true' }} | |
run: | | |
npm run build | |
build-self-hosted: | |
name: Build Self Hosted Image | |
secrets: inherit | |
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'codecov' }} | |
uses: codecov/gha-workflows/.github/workflows/[email protected] | |
with: | |
repo: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-frontend' }} | |
cache_requirements: false | |
self-hosted: | |
name: Push Self Hosted Image | |
needs: [ build-self-hosted, test ] | |
secrets: inherit | |
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'codecov' }} | |
uses: codecov/gha-workflows/.github/workflows/[email protected] | |
with: | |
push_rolling: true | |
repo: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-frontend' }} | |
cache_requirements: false |