Skip to content

Commit

Permalink
feat(ci): basic github action
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Oct 6, 2020
1 parent 0f0a02d commit 0a93d69
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: ci
on: [push, pull_request]

env:
XDG_CACHE_HOME: ${{ github.workspace }}/.cache

jobs:

test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]

steps:
- name: Check out Git repository
uses: actions/checkout@v1

- name: Install Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Cache bigger downloads
uses: actions/cache@v2
id: cache
with:
path: ${{ github.workspace }}/.cache
key: ${{ runner.os }}-${{ hashFiles('package*json', '*config.js') }}
restore-keys: |
${{ runner.os }}-${{ hashFiles('package*json', '*config.js') }}
${{ runner.os }}-
- name: Install dependencies
run: npm run ci:install # TODO npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm

- name: Build
run: npm run build

- name: Show build/
run: du -sh build/ && ls -l build/

- name: Test
run: npm run test

- name: Lint
run: npm run lint

# Persist produced binaries and effective config used for building them
# - this is not for releases, but for quick testing during the dev
# - action artifacts can be downloaded for 90 days, then are removed by github
# - binaries in PRs from forks won't be signed
- name: Attach produced packages to Github Action
uses: actions/upload-artifact@v2
with:
name: build-${{ matrix.os }}
path: build/ipfs_companion*.*
if-no-files-found: error

- name: Show Cache
run: du -sh ${{ github.workspace }}/.cache/ && ls -l ${{ github.workspace }}/.cache/

0 comments on commit 0a93d69

Please sign in to comment.