Skip to content

Commit

Permalink
ci: test CI (#468)
Browse files Browse the repository at this point in the history
* chore: update CI

* chore: update CIv2

* chore: update CI print path

* chore: update CI print path v2

* chore: update CI fix path for codegen

---------

Co-authored-by: Marcin Jarczewski <mjarczewski@box.com>
  • Loading branch information
Percival33 and Marcin Jarczewski authored Oct 22, 2024
1 parent eb91200 commit c2bfe63
Show file tree
Hide file tree
Showing 2 changed files with 39,946 additions and 34 deletions.
66 changes: 32 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
- jp-partial
# Run for PRs on main and staging
pull_request:
branches: [main, staging]
branches: [ main, staging, mj-main ]

jobs:
# The lint job checks that all content is sanitized,
Expand All @@ -23,16 +23,16 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10

# We use node 14 and Python 3.8
# We use node 18
strategy:
matrix:
node-version: [14.x]
python-version: [3.8]
node-version: [ 18.x ]
python-version: [ 3.8 ]

# The following steps are performed for each lint job
steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
Expand Down Expand Up @@ -61,13 +61,14 @@ jobs:
push-to-en:
# We run this on the latest ubuntu
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
# TODO: change it back
if: github.ref == 'refs/heads/mj-main'
timeout-minutes: 10

# We use node 14.X
# We use node 18.X
strategy:
matrix:
node-version: [14.x]
node-version: [ 18.x ]

# Requires the lint and test jobs to pass first
needs:
Expand All @@ -76,25 +77,19 @@ jobs:
# The following steps are performed for each job
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build content
run: |
yarn install
yarn build:spec
yarn build:content
- name: Push API specification
uses: s0/git-publish-subdir-action@v2.4.0
env:
REPO: self
BRANCH: en
FOLDER: compiled/spec
BRANCH: mj-en
FOLDER: openapi
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Notify other repositories of update
Expand Down Expand Up @@ -140,13 +135,13 @@ jobs:
push-to-en-staging:
# We run this on the latest ubuntu
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/staging'
if: github.ref == 'refs/heads/mj-staging'
timeout-minutes: 10

# We use node 14.X
# We use node 18.X
strategy:
matrix:
node-version: [14.x]
node-version: [ 18.x ]

# Requires the lint and test jobs to pass first
needs:
Expand All @@ -155,24 +150,19 @@ jobs:
# The following steps are performed for each job
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Build content
run: |
yarn install
yarn build:spec
- name: Push API specification
uses: s0/git-publish-subdir-action@v2.4.0
env:
REPO: self
BRANCH: en-staging
FOLDER: compiled/spec
BRANCH: mj-staging
FOLDER: openapi
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Trigger Netlify deployment"
Expand Down Expand Up @@ -209,17 +199,18 @@ jobs:
# The following steps are performed for each job
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: box-openapi
ref: apimgmt-558

- name: Set up Node.js 16.x
- name: Set up Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 20.x

- name: Check out the Codegen repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: box/box-codegen
ref: main
Expand All @@ -232,5 +223,12 @@ jobs:
npm install
cd scripts
npm install
cp $GITHUB_WORKSPACE/box-openapi/openapi.json .
npm run generate ./openapi.json output typescript,swift,python,c#
echo "pwd"
pwd
echo "GITHUB_WORKSPACE"
ls $GITHUB_WORKSPACE
echo "GITHUB_WORKSPACE/box-openapi"
ls $GITHUB_WORKSPACE/box-openapi
echo "GITHUB_WORKSPACE/box-openapi/openapi"
ls $GITHUB_WORKSPACE/box-openapi/openapi
npm run generate $GITHUB_WORKSPACE/box-openapi/openapi/openapi.json output typescript,swift,python,c#
Loading

0 comments on commit c2bfe63

Please sign in to comment.