-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (86 loc) · 2.59 KB
/
build-and-test.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
name: Build and Test
run-name: Build/Test for PR #${{ github.event.number }} on ${{ github.head_ref }}
on:
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
lint-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Lint Dockerfile
uses: hadolint/[email protected]
with:
dockerfile: "Dockerfile"
failure-threshold: error
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
severity: error
scandir: './bin'
- name: Lint Python Files Using Black
uses: psf/black@stable
with:
options: "--check --verbose"
src: "./palworldsettings_from_env_vars"
version: "~= 23.0"
- name: Build Docker image (Push To Cache)
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: false
load: true
tags: johnnyknighten/palworld-server:latest
cache-to: type=gha,mode=max
test:
runs-on: ubuntu-latest
needs:
- lint-and-build
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image (From Cache)
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: false
load: true
tags: johnnyknighten/palworld-server:latest
cache-from: type=gha
- name: Set Execute Permission For All Test Scripts
run: chmod -R +x ./tests/
- name: Dependencies Tests
run: |
./tests/dependencies.sh
- name: Bin Script - system-bootstrap Tests
run: |
./tests/bin_scripts/system-bootstrap.sh
- name: Bin Script - palworld-boostrap Tests
run: |
./tests/bin_scripts/palworld-bootstrap.sh
- name: Bin Script - palworld-updater Tests
run: |
./tests/bin_scripts/palworld-updater.sh
- name: Bin Script - palworld-server Tests
run: |
./tests/bin_scripts/palworld-server.sh
- name: Bin Script - palworld-backup Tests
run: |
./tests/bin_scripts/palworld-backup.sh
- name: Ensure Python 3.10 Is Installed For Unit Testing of palworldsettings_from_env_vars
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Unit Tests - palworldsettings_from_env_vars
run: |
python3 -m unittest tests/palworldsettings_from_env_vars/test_main.py -v