Skip to content

Commit

Permalink
ci: update GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard committed Oct 3, 2022
1 parent 9f354de commit 603de03
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 51 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/etl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,28 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Cache node modules
uses: actions/cache@v2
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-modules-${{ env.cache-name }}-
${{ runner.os }}-modules-
${{ runner.os }}-
- name: Install project dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
# Keep the Cypress binary in ./node_modules/.cypress
CYPRESS_CACHE_FOLDER: './node_modules/.cypress'
CYPRESS_INSTALL_BINARY: '0'
PUPPETEER_SKIP_DOWNLOAD: 'true'
run: yarn install

- name: Build packages
Expand Down
40 changes: 16 additions & 24 deletions .github/workflows/lint.yml → .github/workflows/lintChanged.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint
name: Lint changed files

on: [push, pull_request]

Expand All @@ -8,28 +8,30 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Cache node modules
uses: actions/cache@v2
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-modules-${{ env.cache-name }}-
${{ runner.os }}-modules-
${{ runner.os }}-
- name: Install project dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
env:
PUPPETEER_SKIP_DOWNLOAD: 'true'
CYPRESS_INSTALL_BINARY: '0'
# Keep the Cypress binary in ./node_modules/.cypress
CYPRESS_CACHE_FOLDER: './node_modules/.cypress'
CYPRESS_INSTALL_BINARY: '0'
PUPPETEER_SKIP_DOWNLOAD: 'true'
run: yarn install

# Required for import lint rules to work - packages pointing to ex
# `lib/index.js`, where `src/index.ts` gets compiled to `lib/index.js`
- name: Build modules
id: buildModules
run: yarn build
env:
NODE_OPTIONS: --max_old_space_size=8192

- name: Lint changed files
id: listChangedFiles
run: |
Expand All @@ -55,13 +57,3 @@ jobs:
do
yarn eslint $FILE_NAME
done
# - name: Notify Slack about build failure
# if: failure() && github.ref == 'refs/heads/ui/main'
# env:
# SLACK_BOT_TOKEN: ${{ secrets.ACTIONS_SLACK_BOT_TOKEN }}
# uses: voxmedia/github-action-slack-notify-build@v1
# with:
# channel: studio-internal
# status: FAILED
# color: danger
47 changes: 24 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,42 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Cache node modules
uses: actions/cache@v2
id: cache-node-modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-modules-${{ env.cache-name }}-
${{ runner.os }}-modules-
${{ runner.os }}-
- name: Install project dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
env:
# Keep the Cypress binary in ./node_modules/.cypress
CYPRESS_CACHE_FOLDER: './node_modules/.cypress'
CYPRESS_INSTALL_BINARY: '0'
# PUPPETEER_SKIP_DOWNLOAD: 'true'
run: yarn install

- name: Check formatting
run: yarn check:format

- name: Typecheck modules
- name: Check type system
# If TypeScript project references is set up properly, `tsc --build` should work right after dependencies
# has been installed, no extra build/compile step required
id: typeCheckModules
run: yarn type-check
env:
NODE_OPTIONS: --max_old_space_size=8192

# Required for import lint rules to work - packages pointing to ex
# `lib/index.js`, where `src/index.ts` gets compiled to `lib/index.js`
- name: Build modules
id: buildResolver
run: yarn build
env:
NODE_OPTIONS: --max_old_space_size=8192

- name: Check for unused or missing dependencies
- name: Check for unused/missing dependencies
id: depcheck
run: yarn depcheck
env:
Expand All @@ -68,17 +71,15 @@ jobs:
id: test
run: yarn test

# Required for import lint rules to work - packages pointing to ex
# `lib/index.js`, where `src/index.ts` gets compiled to `lib/index.js`
- name: Build modules
id: buildResolver
run: yarn build
env:
NODE_OPTIONS: --max_old_space_size=8192

- name: Test CLI
working-directory: ${{ env.GITHUB_WORKSPACE }}
run: |
node scripts/testCli.js
# - name: Notify Slack about build failure
# if: failure() && github.ref == 'refs/heads/next'
# env:
# SLACK_BOT_TOKEN: ${{ secrets.ACTIONS_SLACK_BOT_TOKEN }}
# uses: voxmedia/github-action-slack-notify-build@v1
# with:
# channel: studio-internal
# status: FAILED
# color: danger

0 comments on commit 603de03

Please sign in to comment.