Skip to content

Merge branch 'master' into dependabot/github_actions/docker/login-act… #152

Merge branch 'master' into dependabot/github_actions/docker/login-act…

Merge branch 'master' into dependabot/github_actions/docker/login-act… #152

Workflow file for this run

# validate YAML
# https://codebeautify.org/yaml-validator
name: Build and Test
on: [push, pull_request]
jobs:
build-test:
name: build-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-nodejs
# https://github.com/actions/setup-node/
- uses: actions/setup-node@v3
with:
node-version: '14'
# https://github.com/marketplace/actions/mongodb-in-github-actions
- name: Start MongoDB
uses: supercharge/[email protected]
with:
mongodb-version: 4.4
- run: npm install
# ampersand means run in the background
# sleep and wait for the app to load
# start running casperjs tests
- run: node app.js &
- run: sleep 6
- run: npm test
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Test Building Docker Image
id: docker_build
# https://github.com/docker/build-push-action
uses: docker/build-push-action@v2
with:
push: false
tags: ghcr.io/carlsonp/kort:latest
platforms: linux/amd64,linux/arm64
# https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md
cache-from: type=registry,ref=ghcr.io/carlsonp/kort:latest
cache-to: type=inline
# https://github.com/snyk/actions/tree/master/node
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}