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

Commit

Permalink
build: enable caching + other GitHub action refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinpinto committed Dec 25, 2019
1 parent d1e7a9b commit 3792d28
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 47 deletions.
35 changes: 0 additions & 35 deletions .github/workflows/ci.yml

This file was deleted.

27 changes: 21 additions & 6 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,37 @@ on:
push:
branches:
- "master"
tags-ignore:
- "*"

jobs:
pre-release:
name: "Pre Release"
gh_pre_release:
runs-on: "ubuntu-latest"
env:
JEST_VERBOSE: ${{ secrets.JEST_VERBOSE }}

steps:
- name: "Checkout source code"
uses: "actions/checkout@v1"
with:
lfs: true

- name: "Install and build"
run: |
yarn run reinstall
yarn run build
- id: "yarn-cache"
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: "actions/cache@v1"
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- uses: "actions/cache@v1"
with:
path: "node_modules"
key: ${{ runner.os }}-yarn-node-modules${{ hashFiles('**/yarn.lock') }}

- run: "yarn install --frozen-lockfile"
- run: "yarn lint"
- run: "yarn test"
- run: "yarn build"

- uses: "./packages/automatic-releases/"
with:
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/tagged-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,33 @@ on:
- "v*"

jobs:
tagged-release:
name: "Tagged Release"
gh_tagged_release:
runs-on: "ubuntu-latest"
env:
JEST_VERBOSE: ${{ secrets.JEST_VERBOSE }}

steps:
- name: "Checkout source code"
uses: "actions/checkout@v1"
with:
lfs: true

- name: "Install and build"
run: |
yarn run reinstall
yarn run build
- id: "yarn-cache"
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: "actions/cache@v1"
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- uses: "actions/cache@v1"
with:
path: "node_modules"
key: ${{ runner.os }}-yarn-node-modules${{ hashFiles('**/yarn.lock') }}

- run: "yarn install --frozen-lockfile"
- run: "yarn lint"
- run: "yarn test"
- run: "yarn build"

- uses: "marvinpinto/action-automatic-releases@latest"
with:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: "tests"

on:
push:
pull_request:
types:
- "opened"
- "closed"
- "reopened"
- "synchronize"

jobs:
gh_tests:
runs-on: "ubuntu-latest"
env:
JEST_VERBOSE: ${{ secrets.JEST_VERBOSE }}

steps:
- name: "Checkout source code"
uses: "actions/checkout@v1"
with:
lfs: true

- id: "yarn-cache"
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: "actions/cache@v1"
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}

- uses: "actions/cache@v1"
with:
path: "node_modules"
key: ${{ runner.os }}-yarn-node-modules${{ hashFiles('**/yarn.lock') }}

- run: "yarn install --frozen-lockfile"
- run: "yarn lint"
- run: "yarn test"
- run: "yarn build"

- uses: "./packages/keybase-notifications"
if: always()
with:
job_status: ${{ job.status }}
opensentinel_owner: ${{ secrets.OSL_OWNER }}
opensentinel_token: ${{ secrets.OSL_TOKEN }}

0 comments on commit 3792d28

Please sign in to comment.