Skip to content

Commit

Permalink
feat: workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
flugg committed Apr 6, 2022
1 parent 42261c5 commit 2776467
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Nettbureau Github

This repository contains shared actions, workflows and other Github related files. The `profile/README.md` also sets the contents visible on our [Github company's page](https://github.com/nettbureau).
33 changes: 33 additions & 0 deletions actions/setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Setup

inputs:
nettbureau-auth-token:
description: "Authentication token for Nettbureau packages"
required: true
fontawesome-auth-token:
description: "Authentication token for Fontawesome packages"
required: true

runs:
using: composite
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Setup private registries
run: |
npm config set "@nettbureau:registry" https://npm.pkg.github.com/
npm config set "//npm.pkg.github.com/:_authToken" ${{ inputs.nettbureau-auth-token }}
npm config set "@fortawesome:registry" https://npm.fontawesome.com/
npm config set "//npm.fontawesome.com/:_authToken" ${{ inputs.fontawesome-auth-token }}
shell: bash

- name: Install dependencies
uses: bahmutov/npm-install@v1
with:
install-command: yarn --frozen-lockfile --ignore-scripts
43 changes: 43 additions & 0 deletions workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build

on:
workflow_call:
secrets:
GITHUB_TOKEN:
required: true
FONTAWESOME_AUTH_TOKEN:
required: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/setup
with:
nettbureau-auth-token: ${{ secrets.GITHUB_TOKEN }}
fontawesome-auth-token: ${{ secrets.FONTAWESOME_AUTH_TOKEN }}

- name: Run linting
run: yarn lint

test:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/setup
with:
nettbureau-auth-token: ${{ secrets.GITHUB_TOKEN }}
fontawesome-auth-token: ${{ secrets.FONTAWESOME_AUTH_TOKEN }}

- name: Run tests
run: yarn test --ci --coverage

build:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/setup
with:
nettbureau-auth-token: ${{ secrets.GITHUB_TOKEN }}
fontawesome-auth-token: ${{ secrets.FONTAWESOME_AUTH_TOKEN }}

- name: Build code
run: yarn build
27 changes: 27 additions & 0 deletions workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Install

on:
workflow_call:
secrets:
NETTBUREAU_AUTH_TOKEN:
required: true
FONTAWESOME_AUTH_TOKEN:
required: true

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/setup
with:
nettbureau-auth-token: ${{ secrets.GITHUB_TOKEN }}
fontawesome-auth-token: ${{ secrets.FONTAWESOME_AUTH_TOKEN }}

- name: Build code
run: yarn build

- name: Release
run: npx auto shipit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 11 additions & 0 deletions workflows/report-size.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Report Size

on:
workflow_call:

jobs:
report-size:
runs-on: ubuntu-latest
steps:
- name: Report size
uses: preactjs/compressed-size-action@v2

0 comments on commit 2776467

Please sign in to comment.