Skip to content

Commit

Permalink
Integrate github actions. (#1219)
Browse files Browse the repository at this point in the history
* Migrate CI to github actions.

* Add NO_CLIENT env for test suite.

* Map postgres port to localhost.
  • Loading branch information
jnaviask authored Jun 8, 2021
1 parent dee3b7a commit dc2438f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 37 deletions.
37 changes: 0 additions & 37 deletions .circleci/config.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build
on: [push]

jobs:
build:
name: Build
runs-on: ubuntu-latest

services:
postgres:
image: postgres
env:
POSTGRES_USER: commonwealth
POSTGRES_DB: commonwealth
POSTGRES_PASSWORD: edgeware
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

steps:
- name: Checkout
uses: actions/checkout@v1

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

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn

- name: Run tests
run: yarn test-suite
env:
NO_CLIENT: true

- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: coverage

0 comments on commit dc2438f

Please sign in to comment.