forked from nuts-foundation/nuts-node
-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (80 loc) · 2.83 KB
/
e2e-tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
---
name: 'E2E tests'
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
branches:
- master
- 'V*'
jobs:
e2e-test:
permissions:
packages: write
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 Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setting git SHA to PR head
if: ${{ github.event_name == 'pull_request' }}
run: echo "SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
- name: Setting git SHA to branch head
if: ${{ github.event_name != 'pull_request' }}
run: echo "SHA=${{ github.sha }}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v4
if: ${{ github.actor != 'dependabot' }}
with:
context: .
file: Dockerfile
platforms: linux/amd64
push: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
tags: ghcr.io/nuts-foundation/nuts-node-ci:${{ env.SHA }}
secrets: |
GIT_AUTH_TOKEN=${{ secrets.PACKAGE_SECRET }}
- name: Build and push dependabot
uses: docker/build-push-action@v4
if: ${{ github.actor == 'dependabot' }}
with:
context: .
file: Dockerfile
platforms: linux/amd64
push: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
tags: ghcr.io/nuts-foundation/nuts-node-ci:${{ env.SHA }}
- name: Run E2E tests
run: |
cd e2e-tests && \
find . -type f -name "docker-compose.yml" | xargs -I{} sed -i 's~nutsfoundation/nuts-node:master~ghcr.io/nuts-foundation/nuts-node-ci:${{ env.SHA }}~g' {} && \
find . -type f -name "run-test.sh" | xargs -I{} sed -i 's/docker-compose exec/docker-compose exec -T/g' {} && \
./run-tests.sh
- name: package cleanup
uses: bots-house/[email protected]
if: ${{ github.actor != 'dependabot' }}
with:
owner: nuts-foundation
name: nuts-node-ci
# NOTE: using Personal Access Token
token: ${{ secrets.PACKAGE_SECRET }}
tag: ${{ env.SHA }}
- name: package cleanup dependabot
uses: bots-house/[email protected]
if: ${{ github.actor == 'dependabot' }}
with:
owner: nuts-foundation
name: nuts-node-ci
# NOTE: using Personal Access Token
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ env.SHA }}