-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (98 loc) · 2.96 KB
/
main.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
name: Build
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read
packages: read
env:
DRAKY_IMAGE_PATH: 'dist/draky-local-build.image.tar'
DRAKY_IMAGE_ARTIFACT_NAME: 'draky-image'
DRAKY_DRAKY_PATH: dist/bin/draky
DRAKY_DRAKY_ARTIFACT_NAME: 'draky'
jobs:
build:
name: Building draky.
runs-on: ubuntu-latest
container:
image: docker:24.0.2-dind-alpine3.18
steps:
- name: checkout repo
uses: actions/checkout@v3.5.3
- name: Installing basic dependencies.
run: apk add make bash
- name: Install other dependencies.
run: make install_build_dependencies_alpine
- name: Building.
run: make build
- name: Preserve image
uses: actions/upload-artifact@v3.1.2
with:
name: ${{ env.DRAKY_IMAGE_ARTIFACT_NAME }}
path: ${{ env.DRAKY_IMAGE_PATH }}
retention-days: 1
- name: Preserve draky
uses: actions/upload-artifact@v3.1.2
with:
name: ${{ env.DRAKY_DRAKY_ARTIFACT_NAME }}
path: ${{ env.DRAKY_DRAKY_PATH }}
retention-days: 1
test-core:
name: Testing draky-core.
runs-on: ubuntu-latest
needs: [build]
steps:
- name: checkout repo
uses: actions/checkout@v3.5.3
- name: Installing basic dependencies.
run: sudo apt install make
- name: Retrieve saved Docker image
uses: actions/download-artifact@v3.0.2
with:
name: ${{ env.DRAKY_IMAGE_ARTIFACT_NAME }}
path: dist
- name: Loading image.
run: docker load --input $DRAKY_IMAGE_PATH
- name: Testing core.
run: make test-core
test-functional:
name: Testing functional.
runs-on: ubuntu-latest
needs: [build]
steps:
- name: checkout repo
uses: actions/checkout@v3.5.3
- name: Installing basic dependencies.
run: sudo apt install make
- name: Retrieve saved Docker image
uses: actions/download-artifact@v3.0.2
with:
name: ${{ env.DRAKY_IMAGE_ARTIFACT_NAME }}
path: dist
- name: Retrieve saved draky script
uses: actions/download-artifact@v3.0.2
with:
name: ${{ env.DRAKY_DRAKY_ARTIFACT_NAME}}
path: dist/bin
- name: Making sure that draky script is executable.
run: chmod u+x ${{ env.DRAKY_DRAKY_PATH }}
- name: Loading image.
run: docker load --input $DRAKY_IMAGE_PATH
- name: Running functional tests.
run: make test-functional
test-lint:
name: Testing linting.
runs-on: ubuntu-latest
needs: [build]
steps:
- name: checkout repo
uses: actions/checkout@v3.5.3
- name: Installing basic dependencies.
run: sudo apt install make
- name: Retrieve saved Docker image
uses: actions/download-artifact@v3.0.2
with:
name: ${{ env.DRAKY_IMAGE_ARTIFACT_NAME }}
path: dist
- name: Loading image.
run: docker load --input $DRAKY_IMAGE_PATH
- name: Running linter.
run: sudo make test-lint