diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000..392432ec9 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,33 @@ +name: Docker Build + +on: [push, pull_request] + +jobs: + buildx: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) + - name: Change for master + id: change_version + run: if [ "${{ steps.get_version.outputs.VERSION }}" == "master" ]; then echo ::set-output name=VERSION::latest; else echo ::set-output name=VERSION::${{ steps.get_version.outputs.VERSION }}; fi + - name: Set up Docker Buildx + id: buildx + uses: crazy-max/ghaction-docker-buildx@v1.0.5 + with: + version: latest + + - name: Build + env: + DOCKER_CLI_EXPERIMENTAL: enabled + run: | + docker buildx build \ + -t cyberreboot/crviz:${{ steps.change_version.outputs.VERSION }} . + docker buildx build \ + -f Dockerfile.gh \ + -t cyberreboot/crviz-gh:${{ steps.change_version.outputs.VERSION }} . + if: github.repository == 'cyberreboot/crviz' diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 8c7db8f12..7c76e1c5a 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -1,6 +1,6 @@ -name: Node.js CI +name: Unit Tests -on: [push] +on: [push, pull_request] jobs: build: @@ -21,3 +21,10 @@ jobs: - run: npm test env: CI: true + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1.0.5 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + token: ${{ secrets.CODECOV_TOKEN }} + if: github.repository == 'cyberreboot/crviz' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4bc15aa45..000000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -sudo: false - -language: node_js -node_js: -- '12' - -dist: xenial - -before_install: - - sudo apt-get update - - sudo apt-get install docker-ce - - npm cache clean --force - -install: - - npm install -g codecov - -cache: - directories: - - $HOME/.npm - - node_modules - -script: -- npm ci --no-optional -- npm run test -- codecov -- npm run build -- docker build -t crviz -f Dockerfile . -- docker build -t crviz-gh -f Dockerfile.gh . \ No newline at end of file