-
Notifications
You must be signed in to change notification settings - Fork 9
65 lines (65 loc) · 2.38 KB
/
action.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
name: action
on:
push:
branches: [main]
schedule:
- cron: '0 0 * * *'
pull_request:
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: hadolint for controller
run: docker run -e "HADOLINT_IGNORE=DL3008" --rm -i hadolint/hadolint < controller/Dockerfile
- name: hadolint for compute
run: docker run -e "HADOLINT_IGNORE=DL3008" --rm -i hadolint/hadolint < compute/Dockerfile
test:
runs-on: ubuntu-22.04
steps:
- name: Remove unused files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v2
- name: Install docker-compose
uses: ndeloof/install-compose-action@v0.0.1
with:
version: v2.17.3
legacy: true
- run: docker-compose --version
- name: Build Images
run: |
docker-compose --file docker-compose.build.yaml up -d
sleep 1800
docker-compose --file docker-compose.build.yaml logs -t --tail=100
docker-compose --file docker-compose.build.yaml exec -T --user stack controller /bin/test.bash
for c in controller compute-1 compute-2; do
docker-compose --file docker-compose.build.yaml exec -T $c /bin/bash -c /bin/pre-commit.bash
done
docker-compose --file docker-compose.build.yaml stop
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push to Docker Hub
if: github.event_name != 'schedule'
env:
tag: "${{ github.ref == 'refs/heads/main' && 'latest' || github.sha }}"
run: |
for c in controller compute-1 compute-2; do
docker commit $c bobuhiro11/containerized-devstack-$c:$tag
docker push bobuhiro11/containerized-devstack-$c:$tag
done
- name: Test Images
if: github.event_name != 'schedule'
env:
tag: "${{ github.ref == 'refs/heads/main' && 'latest' || github.sha }}"
run: |
sed -i -e "s/image:.*/&:$tag/g" docker-compose.yaml
docker-compose up -d
sleep 180
docker-compose exec -T --user stack controller /bin/test.bash