Skip to content

Commit

Permalink
feat: setup ci flow
Browse files Browse the repository at this point in the history
  • Loading branch information
zarianec committed Mar 17, 2022
1 parent 9a860a8 commit 1119ff9
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 26 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Build and test

on:
workflow_call: {}

jobs:
test:
name: Build and test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16.x
- name: install and build
run: npm ci && npm run build
- name: lint and test
run: |
npm run lint
npm run test:coverage
11 changes: 11 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Run tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
uses: ./.github/workflows/_test.yaml
22 changes: 0 additions & 22 deletions .github/workflows/ci.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release probe

on:
push:
tags:
- 'v*.*.*'

jobs:
test:
uses: ./.github/workflows/_test.yaml

publish:
runs-on: ubuntu-latest
needs: test

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v2

- name: Log into registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}
tags: type=semver,pattern={{version}}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "runner",
"version": "1.0.0",
"version": "0.1.0",
"description": "",
"type": "module",
"main": "index.js",
"main": "dist/index.js",
"author": "Artem Stoianov <stoianov.artem@gmail.com>",
"license": "ISC",
"dependencies": {
Expand Down

0 comments on commit 1119ff9

Please sign in to comment.