Skip to content

Commit

Permalink
chore(build): add an initial variation of GitHub actions for build
Browse files Browse the repository at this point in the history
  • Loading branch information
DethAriel committed Nov 18, 2021
1 parent 74eae96 commit 9c02660
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and test
on: [push]
# on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
jobs:
build-demo:
name: Build demo site
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/setup.yml
- name: Build the demo site
run: yarn demo:build
static-analysis:
name: Run static code analysis
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/setup.yml
- name: Run lint
run: yarn lint
- name: Check code styles
run: yarn prettier --check --ignore-unknown *
tests-unit:
name: Run unit tests
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/setup.yml
- name: Test the lib
run: yarn ng test ng-recaptcha --code-coverage
# - name: Upload code coverage results to coveralls
# run: yarn coveralls < coverage/ng-recaptcha/lcov.info
tests-e2e:
name: Run end-to-end tests
runs-on: ubuntu-latest
steps:
- uses: ./.github/workflows/setup.yml
- name: Run e2e tests for demo site
run: yarn ng e2e demo
22 changes: 22 additions & 0 deletions .github/workflows/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Reusable setup steps
on: [workflow_call]

jobs:
setup:
name: Set up the repo
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
name: Set up Node.js
# Should be in sync with .nvmrc
node-version: "14"
cache: "yarn"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Generate source files for demo site
run: yarn demo:file-gen
- name: Build the lib # things like "lint" depend on the lib being built, so it's in the "setup" job
run: yarn lib:build

0 comments on commit 9c02660

Please sign in to comment.