Skip to content

Commit 388f5ae

Browse files
committed
test(workflows): Add test workflow
1 parent ee62384 commit 388f5ae

File tree

188 files changed

+7573
-8383
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+7573
-8383
lines changed

.eslintrc.json

-51
This file was deleted.

.github/workflows/create-docker-hub-image.yml

+28-13
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,43 @@ jobs:
88
build:
99
runs-on: ubuntu-latest
1010
env:
11-
DOCKER_ORGANIZATION: ${{secrets.DOCKER_ORGANIZATION}}
11+
DOCKER_ORGANIZATION: ${{ secrets.DOCKER_ORGANIZATION }}
1212

1313
steps:
1414
- uses: actions/checkout@v2
1515

16-
- name: Docker Hub Login
17-
env:
18-
DOCKER_USER: ${{secrets.DOCKER_USER}}
19-
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
20-
run: |
21-
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USER --password-stdin
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v2
18+
19+
- name: Set up Docker Buildx
20+
id: buildx
21+
uses: docker/setup-buildx-action@v2
22+
with:
23+
install: true
24+
25+
- name: Log in to Docker Hub
26+
uses: docker/login-action@v2
27+
with:
28+
username: ${{ secrets.DOCKER_USER }}
29+
password: ${{ secrets.DOCKER_PASSWORD }}
2230

2331
- name: Extract branch name
2432
shell: bash
2533
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
2634
id: extract_branch
2735

28-
- name: Build the Docker image
29-
run: docker build -t web-app:latest .
36+
- name: Get Git Hashes
37+
run: |
38+
echo "short_hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
39+
echo "long_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
40+
id: git_hashes
41+
42+
- name: Build and Push Multi-Arch Docker Image
43+
run: |
44+
TAGS="--tag $DOCKER_ORGANIZATION/web-app:${{ steps.extract_branch.outputs.branch }}"
3045
31-
- name: Docker Hub Prepare
32-
run: docker image tag web-app $DOCKER_ORGANIZATION/web-app:${{ steps.extract_branch.outputs.branch }}
46+
if [ "${{ steps.extract_branch.outputs.branch }}" == "master" ]; then
47+
TAGS="$TAGS --tag $DOCKER_ORGANIZATION/web-app:${{ steps.git_hashes.outputs.short_hash }} --tag $DOCKER_ORGANIZATION/web-app:${{ steps.git_hashes.outputs.long_hash }}"
48+
fi
3349
34-
- name: Docker Hub Push
35-
run: docker image push $DOCKER_ORGANIZATION/web-app:${{ steps.extract_branch.outputs.branch }}
50+
docker build --push --build-arg="PUPPETEER_SKIP_DOWNLOAD_ARG=true" --platform linux/amd64,linux/arm64 $TAGS .

.github/workflows/test.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
testRigor:
11+
runs-on: ubuntu-latest
12+
env:
13+
MIFOS_TEST_SUITE_ID: ${{secrets.MIFOS_TEST_SUITE_ID}}
14+
MIFOS_AUTH_TOKEN: ${{secrets.MIFOS_AUTH_TOKEN}}
15+
LOCALHOST_URL: ${{secrets.LOCALHOST_URL}}
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
- name: Use Node.js 22
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: '22.9.0'
24+
25+
- name: Install testRigor Command Line
26+
run: |
27+
npm install -g testrigor-cli
28+
sudo apt-get install jq
29+
30+
- name: Run testRigor tests
31+
run: |
32+
chmod +x ./e2e/testRigor/run_testrigor_tests.sh && ./e2e/testRigor/run_testrigor_tests.sh

.htmlhintrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"title-require": true,
1111
"tag-self-close": false,
1212
"head-script-disabled": true,
13-
"doctype-html5": true,
14-
"id-class-value": "dash",
13+
"DOCTYPE-html5": true,
14+
"id-class-value": false,
1515
"style-disabled": true,
1616
"inline-style-disabled": true,
1717
"inline-script-disabled": true,

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
### STAGE 1: Build app
33
###############
44
ARG BUILDER_IMAGE=node:22.9.0-alpine
5-
ARG NGINX_IMAGE=nginx:1.27.3
5+
ARG NGINX_IMAGE=nginx:1.27.4-alpine3.21-slim
66

77
FROM $BUILDER_IMAGE as builder
88
ARG NPM_REGISTRY_URL=https://registry.npmjs.org/

0 commit comments

Comments
 (0)