Skip to content

Commit

Permalink
Fix Github Actions CI (#1053)
Browse files Browse the repository at this point in the history
* Update docker-pr-build.yml

Add python-is-python3 apt package

* Update docker-release-build.yml

Add python-is-python3 ( Ubuntu 20.04 )

* Switch to ubuntu-20.04

* Switch to ubuntu-20.04

* Switch to ubuntu-20.04

* Bump actions and Fix codecov ( git depth )

* download-artifact@v2 Fix path

* Add Master branch tests workflow
  • Loading branch information
VonOx authored Jan 28, 2021
1 parent 65789bd commit 9ec3f15
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 33 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/docker-dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ on:
jobs:
build-front:
name: Front build
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout code
uses: actions/checkout@v2
-
name: πŸ’½ Setup nodejs
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: '12'
-
name: πŸ“‡ Use npm cache
uses: c-hive/gha-npm-cache@v1
Expand All @@ -40,14 +40,14 @@ jobs:
npm run build
-
name: ↗️ Upload build artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: static
path: front/build
docker:
needs: build-front
name: Docker magic !
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
env:
DOCKERHUB_USER: ${{secrets.DOCKERHUB_USER}}
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
Expand Down Expand Up @@ -75,9 +75,10 @@ jobs:
version: latest
-
name: ↙️ Download build artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v2
with:
name: static
path: static
-
name: πŸ”‘ Login to DockerHub
uses: docker/login-action@v1
Expand All @@ -95,4 +96,4 @@ jobs:
pull: true
tags: ${{ secrets.DOCKERHUB_REPO }}:${{ github.event.inputs.tag }}
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_REPO }}:${{ github.event.inputs.tag }}
cache-to: type=inline
cache-to: type=inline
105 changes: 105 additions & 0 deletions .github/workflows/docker-master-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Master branch tests

on:
push:
branches: [ master ]

jobs:
test-front:
name: Front test
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout Gladys code
uses: actions/checkout@v2
-
name: πŸ’½ Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '12'
-
name: πŸ“‡ Use npm cache
uses: c-hive/gha-npm-cache@v1
-
name: πŸ“¦ Install Global NPM Packages
run: |
sudo npm install typescript node-gyp npm@latest -g
-
name: πŸ“¦ Install NPM front packages
working-directory: ./front
run: |
npm ci
-
name: 🧐 Prettier check
working-directory: ./front
run: |
npm run prettier-check
-
name: πŸ‘• ESlint
working-directory: ./front
run: |
npm run eslint
-
name: 🌐 Integration comparison
working-directory: ./front
run: |
npm run compare-translations
test-server:
name: Server test
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout Gladys code
uses: actions/checkout@v2
with:
fetch-depth: 2
-
name: πŸ’½ Setup nodejs
uses: actions/setup-node@v2
with:
node-version: '12'
-
name: πŸ“‡ Use npm cache
uses: c-hive/gha-npm-cache@v1
-
name: πŸ–₯️ Setup OZW
run: |
docker create -ti --name dummy chrisns/openzwave:ubuntu-1.6.1714 bash
sudo docker cp dummy:/usr/local/include/openzwave /usr/local/include/openzwave
sudo docker cp dummy:/openzwave/libopenzwave.so /usr/local/lib
sudo docker cp dummy:/openzwave/libopenzwave.so.1.6 /usr/local/lib
sudo docker cp dummy:/openzwave/config /usr/local/etc/openzwave
sudo ldconfig
docker rm -f dummy
-
name: πŸ’½ Install System Dependencies
run: |
sudo apt update
sudo apt-get install -y libudev-dev sqlite3 openssl python-is-python3
-
name: πŸ“¦ Install Global NPM Packages
run: |
sudo npm install typescript node-gyp npm@latest -g
-
name: πŸ“¦ Install NPM server packages
working-directory: ./server
run: |
npm ci
-
name: 🧐 Prettier check
working-directory: ./server
run: |
npm run prettier-check
-
name: πŸ‘• ESlint
working-directory: ./server
run: |
npm run eslint
-
name: βœ… Test with coverage
working-directory: ./server
run: |
npm run coverage
-
name: πŸ“„ Codecov report upload
uses: codecov/codecov-action@v1
29 changes: 16 additions & 13 deletions .github/workflows/docker-pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ on:
jobs:
test-front:
name: Front test
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout Gladys code
uses: actions/checkout@v2
-
name: πŸ’½ Setup nodejs
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: '12'
-
name: πŸ“‡ Use npm cache
uses: c-hive/gha-npm-cache@v1
Expand Down Expand Up @@ -47,16 +47,18 @@ jobs:
npm run compare-translations
test-server:
name: Server test
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout Gladys code
uses: actions/checkout@v2
with:
fetch-depth: 2
-
name: πŸ’½ Setup nodejs
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: '12'
-
name: πŸ“‡ Use npm cache
uses: c-hive/gha-npm-cache@v1
Expand All @@ -74,7 +76,7 @@ jobs:
name: πŸ’½ Install System Dependencies
run: |
sudo apt update
sudo apt-get install -y libudev-dev sqlite3 openssl
sudo apt-get install -y libudev-dev sqlite3 openssl python-is-python3
-
name: πŸ“¦ Install Global NPM Packages
run: |
Expand Down Expand Up @@ -108,16 +110,16 @@ jobs:
needs:
- test-front
- test-server
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout code
uses: actions/checkout@v2
-
name: πŸ’½ Setup nodejs
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: '12'
-
name: πŸ“‡ Use npm cache
uses: c-hive/gha-npm-cache@v1
Expand All @@ -133,15 +135,15 @@ jobs:
npm run build
-
name: ↗️ Upload build artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: static
path: front/build
docker:
if: github.event.pull_request.draft == false
needs: build-front
name: Docker magic !
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout code
Expand All @@ -157,9 +159,10 @@ jobs:
version: latest
-
name: ↙️ Download build artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v2
with:
name: static
path: static
-
name: 🐳 Build AMD64 images
uses: docker/build-push-action@v2
Expand Down
29 changes: 16 additions & 13 deletions .github/workflows/docker-release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ on:
jobs:
test-front:
name: Front test
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout Gladys code
uses: actions/checkout@v2
-
name: πŸ’½ Setup nodejs
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: '12'
-
name: πŸ“‡ Use npm cache
uses: c-hive/gha-npm-cache@v1
Expand Down Expand Up @@ -47,16 +47,18 @@ jobs:
npm run compare-translations
test-server:
name: Server test
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout Gladys code
uses: actions/checkout@v2
with:
fetch-depth: 2
-
name: πŸ’½ Setup nodejs
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: '12'
-
name: πŸ“‡ Use npm cache
uses: c-hive/gha-npm-cache@v1
Expand All @@ -74,7 +76,7 @@ jobs:
name: πŸ’½ Install System Dependencies
run: |
sudo apt update
sudo apt-get install -y libudev-dev sqlite3 openssl
sudo apt-get install -y libudev-dev sqlite3 openssl python-is-python3
-
name: πŸ“¦ Install Global NPM Packages
run: |
Expand Down Expand Up @@ -107,16 +109,16 @@ jobs:
needs:
- test-front
- test-server
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
-
name: ⬇️ Checkout code
uses: actions/checkout@v2
-
name: πŸ’½ Setup nodejs
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 12.x
node-version: '12'
-
name: πŸ“‡ Use npm cache
uses: c-hive/gha-npm-cache@v1
Expand All @@ -132,14 +134,14 @@ jobs:
npm run build
-
name: ↗️ Upload build artifact
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v2
with:
name: static
path: front/build
docker:
needs: build-front
name: Docker magic !
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
env:
DOCKERHUB_USER: ${{secrets.DOCKERHUB_USER}}
DOCKERHUB_PASSWORD: ${{secrets.DOCKERHUB_PASSWORD}}
Expand Down Expand Up @@ -171,9 +173,10 @@ jobs:
version: latest
-
name: ↙️ Download build artifact
uses: actions/download-artifact@v1
uses: actions/download-artifact@v2
with:
name: static
path: static
-
name: πŸ”‘ Login to DockerHub
uses: docker/login-action@v1
Expand Down

0 comments on commit 9ec3f15

Please sign in to comment.