Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

New nodejs base image #262

New nodejs base image

New nodejs base image #262

name: Test
on:
pull_request:
types:
- opened
- synchronize
jobs:
tests:
name: Run linter and tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies
run: yarn install
- name: Lint
run: yarn lint
- name: Check i18n
shell: bash
run: |
yarn i18n
GIT_STATUS="$(git status --short --untracked-files locales)"
if [ -n "$GIT_STATUS" ]; then
echo "i18n files are not up to date. Commit them to fix."
git diff
exit 1
fi
- name: Test
run: yarn test:coverage
- name: Build
run: yarn build
docker-image:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Quay.io
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASS }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
push: false
tags: quay.io/nmstate/nmstate-console-plugin:latest
e2e-tests:
name: Run e2e tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install kinD
run: |
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.17.0/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind
- name: Install k8s and oc
run: |
curl -LO https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz
tar -xvf oc.tar.gz
sudo install oc /usr/local/bin/oc
sudo install kubectl /usr/local/bin/kubectl
- name: Install podman
run: |
curl -LO https://github.com/containers/podman/releases/download/v4.7.1/podman-remote-static-linux_amd64.tar.gz
tar -xvf podman-remote-static-linux_amd64.tar.gz
sudo install ./bin/podman-remote-static-linux_amd64 /usr/local/bin/podman
- name: Create Cluster
run: |
yarn create-cluster
yarn login-cluster
- name: Cypress run
uses: cypress-io/[email protected]
with:
start: yarn dev, yarn start-console
wait-on: "http://localhost:9001"
browser: chrome
headed: false
- uses: actions/upload-artifact@v3
if: always()
with:
name: cypress-videos
path: cypress/videos