-
Notifications
You must be signed in to change notification settings - Fork 15
56 lines (41 loc) · 1.63 KB
/
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
name: Test
on: [ push, pull_request ]
jobs:
test-ubuntu-20_04:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Docker Info
run: |
docker info
- name: Pull golang image
run: |
docker pull golang:1.22
- name: Run tests in Go container (1000m)
run: |
docker run --rm -v=$(pwd):/app -w=/app -m=1000m golang:1.22 go test -v ./... -expected=1048576000
- name: Run tests in Go container (4321m)
run: |
docker run --rm -v=$(pwd):/app -w=/app -m=4321m golang:1.22 go test -v ./... -expected=4530896896
- name: Run tests in Go container (system memory limit)
run: |
docker run --rm -v=$(pwd):/app -w=/app golang:1.22 go test -v ./... -expected-system=$(($(awk '/MemTotal/ {print $2}' /proc/meminfo) * 1024))
test-ubuntu-22_04:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Docker Info
run: |
docker info
- name: Pull golang image
run: |
docker pull golang:1.22
- name: Run tests in Go container (1000m)
run: |
docker run --rm -v=$(pwd):/app -w=/app -m=1000m golang:1.22 go test -v ./... -expected=1048576000
- name: Run tests in Go container (4321m)
run: |
docker run --rm -v=$(pwd):/app -w=/app -m=4321m golang:1.22 go test -v ./... -expected=4530896896
- name: Run tests in Go container (system memory limit)
run: |
docker run --rm -v=$(pwd):/app -w=/app golang:1.22 go test -v ./... -expected-system=$(($(awk '/MemTotal/ {print $2}' /proc/meminfo) * 1024))