Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #565 from JupiterOne/INT-5629-gh-actions
Browse files Browse the repository at this point in the history
INT-5629 - Cache packages in `actions/setup-node`
  • Loading branch information
austinkelleher authored Dec 22, 2022
2 parents 22c35ca + 384be45 commit bbd0a2f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 25 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out code repository source code
uses: actions/checkout@v3

- id: setup-node
name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 14.x

- name: Check out code repository source code
uses: actions/checkout@v2
cache: 'yarn'

- name: Install dependencies
run: yarn
run: yarn --frozen-lockfile

- name: Run tests
run: yarn test:ci
Expand All @@ -36,11 +37,12 @@ jobs:
name: Checkout Code
steps:
- name: Setup Node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: 'yarn'
- name: Check out repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.AUTO_GITHUB_PAT_TOKEN }}
Expand Down
39 changes: 21 additions & 18 deletions .github/workflows/questions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,36 @@ jobs:
runs-on: ubuntu-latest

steps:
- id: setup-node
name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Check out `main` branch
uses: actions/checkout@v2
with:
uses: actions/checkout@v3
with:
path: source

- name: Check out target branch questions
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
path: target

- id: setup-node
name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 14.x
cache: 'yarn'

- name: Install dependencies for `main` branch
run: yarn install --cwd source
run: yarn install --cwd source --frozen-lockfile

- name: Validate questions on target branch
env:
MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID: ${{ secrets.MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID }}
MANAGED_QUESTIONS_JUPITERONE_API_KEY: ${{ secrets.MANAGED_QUESTIONS_JUPITERONE_API_KEY }}
run: yarn --cwd source
j1-integration validate-question-file
-a $MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID
-k $MANAGED_QUESTIONS_JUPITERONE_API_KEY
-p ../target/jupiterone/questions/questions.yaml
MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID:
${{ secrets.MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID }}
MANAGED_QUESTIONS_JUPITERONE_API_KEY:
${{ secrets.MANAGED_QUESTIONS_JUPITERONE_API_KEY }}
run:
yarn --cwd source j1-integration validate-question-file -a
--frozen-lockfile $MANAGED_QUESTIONS_JUPITERONE_ACCOUNT_ID -k
$MANAGED_QUESTIONS_JUPITERONE_API_KEY -p
../target/jupiterone/questions/questions.yaml

0 comments on commit bbd0a2f

Please sign in to comment.