aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorKamen Mladenov <kamen@syndamia.com>2024-01-08 20:20:32 +0200
committerGitHub <noreply@github.com>2024-01-08 20:20:32 +0200
commit9aca1ce669eb23b734670640a90cc58adeb48807 (patch)
tree9baf38b7f278afb35e3aaa0bf1ddb98949586767 /.github
parentf891b7daabf33d50913edb11dbbfb82a9216327b (diff)
parentfe3e25494bd4472f40e843f75463d49316ff2585 (diff)
downloadpico-web-0.1.0.tar
pico-web-0.1.0.tar.gz
pico-web-0.1.0.zip
Merge pull request #2 from Syndamia/devv0.1.0
Major changes
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/dev-branch.yml90
-rw-r--r--.github/workflows/feature-branch.yml21
-rw-r--r--.github/workflows/main-branch.yml17
3 files changed, 119 insertions, 9 deletions
diff --git a/.github/workflows/dev-branch.yml b/.github/workflows/dev-branch.yml
new file mode 100644
index 0000000..95d580a
--- /dev/null
+++ b/.github/workflows/dev-branch.yml
@@ -0,0 +1,90 @@
+name: Tests, analysis and push to dev dockerhub
+on:
+ push:
+ branches:
+ - dev
+jobs:
+ # This is done to prevent potential race conditions;
+ # multiple jobs start with the source code, but since
+ # they have no "needs", one could start a little bit later,
+ # and in meantime a commit could be pushed
+ Clone-repo:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ submodules: recursive
+ - uses: actions/upload-artifact@v3
+ with:
+ name: source-code
+ path: .
+
+ Tests:
+ runs-on: ubuntu-latest
+ needs: Clone-repo
+ steps:
+ - uses: actions/download-artifact@v3
+ with:
+ name: source-code
+ path: .
+ - name: Run tests
+ run: make tests
+
+ Static-analysis:
+ runs-on: ubuntu-latest
+ needs: Clone-repo
+ steps:
+ - uses: actions/download-artifact@v3
+ with:
+ name: source-code
+ path: .
+ - name: Run satic analysis
+ run: make static-analysis
+
+ Security-analysis:
+ runs-on: ubuntu-latest
+ needs: Clone-repo
+ steps:
+ - uses: actions/download-artifact@v3
+ with:
+ name: source-code
+ path: .
+ - run: sudo apt-get install -y flawfinder
+ - name: Run security analysis
+ run: make security-analysis
+
+ Build:
+ runs-on: ubuntu-latest
+ needs: [ Tests, Static-analysis, Security-analysis ]
+ steps:
+ - uses: actions/download-artifact@v3
+ with:
+ name: source-code
+ path: .
+ - name: Build server and browser
+ run: make dev
+ - uses: actions/upload-artifact@v3
+ with:
+ name: dev-build-files
+ path: ./build
+
+ Build-docker-and-push:
+ name: Build the docker container image and push it to dockerhub
+ runs-on: ubuntu-latest
+ needs: Build
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/download-artifact@v3
+ with:
+ name: dev-build-files
+ path: ./build
+ - uses: docker/login-action@v3
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+ - uses: docker/build-push-action@v5
+ with:
+ push: true
+ context: .
+ file: Dockerfile.dev
+ tags: ${{ secrets.DOCKERHUB_USERNAME }}/pico-web-dev:latest
diff --git a/.github/workflows/feature-branch.yml b/.github/workflows/feature-branch.yml
index 54c0c6b..3ff1833 100644
--- a/.github/workflows/feature-branch.yml
+++ b/.github/workflows/feature-branch.yml
@@ -1,4 +1,4 @@
-name: feature-branch
+name: Tests and static analysis
on:
push:
branches-ignore:
@@ -13,6 +13,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
+ with:
+ submodules: recursive
- uses: actions/upload-artifact@v3
with:
name: source-code
@@ -22,15 +24,20 @@ jobs:
runs-on: ubuntu-latest
needs: Clone-repo
steps:
- - uses: actions/checkout@v4
- - name: Build server and browser
+ - uses: actions/download-artifact@v3
+ with:
+ name: source-code
+ path: .
+ - name: Run tests
run: make tests
- Static analysis:
+ Static-analysis:
runs-on: ubuntu-latest
needs: Clone-repo
steps:
- - uses: actions/checkout@v4
- - name: Build server and browser
+ - uses: actions/download-artifact@v3
+ with:
+ name: source-code
+ path: .
+ - name: Run static analysis
run: make static-analysis
-
diff --git a/.github/workflows/main-branch.yml b/.github/workflows/main-branch.yml
index d8584cb..f19976d 100644
--- a/.github/workflows/main-branch.yml
+++ b/.github/workflows/main-branch.yml
@@ -1,14 +1,16 @@
-name: Push image to dockerhub
+name: Create release and push production server image to dockerhub
on:
push:
branches:
- main
jobs:
- build-and-push:
+ Build-docker-and-push:
name: Build the docker container image and push it to dockerhub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
+ with:
+ submodules: recursive
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -18,3 +20,14 @@ jobs:
push: true
tags: ${{ secrets.DOCKERHUB_USERNAME }}/pico-web-server:latest
+ Release:
+ name: Make github release
+ runs-on: ubuntu-latest
+ needs: Build-docker-and-push
+ steps:
+ - uses: actions/checkout@v4
+ - uses: rymndhng/release-on-push-action@master
+ env:
+ GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
+ with:
+ bump_version_scheme: minor