-
Notifications
You must be signed in to change notification settings - Fork 14
106 lines (86 loc) · 2.71 KB
/
e2e-tests-reviews.yml
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
95
96
97
98
99
100
101
102
103
104
105
106
name: "Haibun e2e tests"
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
permissions:
contents: write
pull-requests: read
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.head_ref }}"
cancel-in-progress: true
jobs:
e2e_test_and_publish:
runs-on: ubuntu-latest
steps:
# Checkout main branch
- uses: actions/checkout@v4
with:
repository: gctools-outilsgc/gcpedia
ref: main
# Set up GitHub Actions bot identity
- name: Set up GitHub Actions bot identity
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
# Build and run Docker container
- name: Build gcpedia docker-compose
run: docker-compose build
- name: Make images directory
run: mkdir images
- name: Set images permissions
run: chmod 777 images/
- name: Start gcpedia docker-compose
run: docker-compose up -d
- name: See the logs
run: docker-compose logs
- name: Wait for it to start
continue-on-error: true
run: |
npx -y wait-on -t 45s tcp:`./haibun/gcpedia-docker-address.sh`:80
- name: See the logs if wait failed
if: steps.wait-for-it.outputs.success == 'false'
run: docker-compose logs
- name: Fail the job if wait failed
if: steps.wait-for-it.outputs.success == 'false'
run: exit 1
# Fetch and switch to gh-pages branch
- name: Fetch and switch to gh-pages branch
run: |
git fetch origin
git checkout gh-pages
git reset --hard origin/main
git checkout origin/gh-pages -- haibun/reviews
# Install haibun dependencies
- name: Install haibun dependencies
run: |
cd haibun
npm ci
npx playwright install-deps
npx playwright install
# Run e2e tests
- name: Run e2e tests
continue-on-error: true
run: |
cd haibun
npm run docker-test
# Remove haibun/failures.test.json to prevent conflicts
- name: Remove failures.test.json
run: |
rm -f haibun/failures.test.json
# Run publish
- name: Run publish
run: |
cd haibun
npm run publish
# Add and commit changes
- name: Add and commit changes
run: |
git add ./haibun/reviews
git commit -m "update e2e test reviews"
# Force push changes to gh-pages
- name: Force push changes to gh-pages
run: |
git push --force origin gh-pages