Skip to content

Commit

Permalink
don't use docker everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
millotp committed Jan 15, 2024
1 parent b69c655 commit 5326587
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 12 deletions.
10 changes: 10 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Setup
description: Setup CI environment.

inputs:
install-node:
description: If true, it will install the node with the version from .nvmrc.
required: false
javascript-utils:
description: If true, it will also restore the cache of the javascript util packages.
required: false
Expand All @@ -22,6 +25,13 @@ runs:
git config --global --add safe.directory /__w/api-clients-automation/api-clients-automation
# JavaScript for monorepo and tooling
- name: Install Node
if: ${{ inputs.install-node == 'true' }}
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn

- name: Get yarn cache directory path
shell: bash
id: yarn-cache-dir
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ concurrency:
jobs:
setup:
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic-base
defaults:
run:
shell: bash
Expand All @@ -39,6 +37,8 @@ jobs:
- name: Setup
id: setup
uses: ./.github/actions/setup
with:
install-node: true

- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
Expand Down Expand Up @@ -103,8 +103,6 @@ jobs:

scripts:
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic-base
timeout-minutes: 10
needs: setup
if: ${{ needs.setup.outputs.RUN_SCRIPTS == 'true' }}
Expand All @@ -113,6 +111,8 @@ jobs:

- name: Setup
uses: ./.github/actions/setup
with:
install-node: true

- name: Check script linting
run: yarn scripts:lint
Expand All @@ -125,8 +125,6 @@ jobs:

specs:
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic-base
timeout-minutes: 10
needs: setup
steps:
Expand All @@ -142,6 +140,8 @@ jobs:
- name: Setup
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
uses: ./.github/actions/setup
with:
install-node: true

- name: Building specs
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
Expand Down Expand Up @@ -392,8 +392,6 @@ jobs:

codegen:
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic-base
timeout-minutes: 10
needs:
- setup
Expand All @@ -418,6 +416,8 @@ jobs:

- name: Setup
uses: ./.github/actions/setup
with:
install-node: true

- name: Push generated code
id: pushGeneratedCode
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
jobs:
notification:
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic-base
timeout-minutes: 10
if: (github.event.action == 'opened' || github.event.action == 'synchronize') && github.event.number
steps:
Expand All @@ -19,6 +17,8 @@ jobs:

- name: Setup
uses: ./.github/actions/setup
with:
install-node: true

- name: Add notification comment
run: yarn workspace scripts upsertGenerationComment notification
Expand All @@ -29,8 +29,6 @@ jobs:

cleanup:
runs-on: ubuntu-22.04
container:
image: ghcr.io/algolia/apic-base
timeout-minutes: 10
if: github.event.action == 'closed'
steps:
Expand All @@ -41,6 +39,8 @@ jobs:

- name: Setup
uses: ./.github/actions/setup
with:
install-node: true

- name: Add cleanup comment
run: yarn workspace scripts upsertGenerationComment cleanup
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/scheduled-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
- name: Setup
id: setup
uses: ./.github/actions/setup
with:
install-node: true

- run: yarn release
env:
Expand Down
5 changes: 5 additions & 0 deletions scripts/ci/githubActions/createMatrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ async function createClientMatrix(baseBranch: string): Promise<void> {
clientMatrix.client.splice(swiftIndex, 1);
}

const phpIndex = clientMatrix.client.findIndex((c) => c.language === 'php');
if (phpIndex !== -1) {
clientMatrix.client.splice(phpIndex, 1);
}

core.setOutput('RUN_GEN', shouldRun);
core.setOutput('GEN_MATRIX', JSON.stringify(shouldRun ? clientMatrix : EMPTY_MATRIX));
}
Expand Down

0 comments on commit 5326587

Please # to comment.