build(deps): update deps & base image #81
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
on: | |
- push | |
- pull_request | |
jobs: | |
super-linter: | |
name: super-linter | |
runs-on: ubuntu-20.04 | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Run super linter | |
uses: github/super-linter/slim@v4 | |
env: | |
DEFAULT_BRANCH: main | |
VALIDATE_ALL_CODEBASE: 'true' | |
VALIDATE_BASH: 'true' | |
VALIDATE_EDITORCONFIG: 'true' | |
VALIDATE_MD: 'true' | |
VALIDATE_YAML: 'true' | |
FILTER_REGEX_EXCLUDE: '.*/(CHANGELOG\.md)' | |
test: | |
name: test | |
runs-on: ubuntu-22.04 | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18.16.0' | |
- name: Get npm cache directory | |
id: npm-cache-dir | |
run: | | |
echo "::set-output name=dir::$(npm config get cache)" | |
- uses: actions/cache@v2 | |
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true' | |
with: | |
path: ${{ steps.npm-cache-dir.outputs.dir }} | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm clean-install | |
- name: Run linting, type checking and tests | |
run: npm test | |
- name: Upload coverage report to codecov | |
uses: codecov/codecov-action@v2 | |
with: | |
flags: unittests | |
fail_ci_if_error: true | |
verbose: true | |
- name: Test build | |
run: npm run build | |
build: | |
name: build | |
runs-on: ubuntu-20.04 | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
push: false | |
tags: kirintwn/node-ts-starter:test | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |