Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Separate gh actions jobs #5731

Merged
merged 4 commits into from
Nov 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 77 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,89 @@ on:
branches: [ development, master ]

jobs:
build:

install:
name: Install Dependencies
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: Get yarn cache path
id: yarn-cache-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
id: cache
with:
path: ${{ steps.yarn-cache-path.outputs.dir }}
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn
- name: Setup Node.js
uses: actions/setup-node@v1
if: steps.cache.outputs.cache-hit != 'true'
with:
node-version: 14.x
- run: yarn
- run: touch .env
- run: yarn l10n:generate
- run: yarn lint
- run: COVERAGE=true yarn test
- run: ROOT_URL=open-event-frontend yarn build -prod
- name: Code Coverage
uses: codecov/codecov-action@v1
if: steps.cache.outputs.cache-hit != 'true'


lint:
name: Lint
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# no restore-keys here, so we only accept this exact version
- run: yarn lint


test:
name: Test
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# no restore-keys here, so we only accept this exact version
- run: yarn l10n:generate
- run: COVERAGE=true yarn test
- name: Code Coverage
uses: codecov/codecov-action@v1


build:
name: Build
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14.x
- uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# no restore-keys here, so we only accept this exact version
- run: yarn l10n:generate
- run: ROOT_URL=open-event-frontend yarn build -prod