forked from NicolasT/static-container-registry
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (71 loc) · 2.55 KB
/
actions.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: static-container-registry
on: push
env:
DOCKER_IMAGE: ghcr.io/${{ github.repository }}
jobs:
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
#TODO: add annotations
#- uses: cclauss/[email protected]
- name: Install dependencies
run: |
pip install pylint
- name: Analysing the code with pylint
run: |
pylint `ls -R|grep .py$|xargs`
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildk
uses: docker/setup-buildx-action@v3
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: "${{ env.DOCKER_IMAGE }}:${{ github.sha }}"
cache-from: type=gha
cache-to: type=gha,mode=max
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
OS=xUbuntu_20.04
CRIO_VERSION=1.21
KUBIC_REPO=https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable
sudo tee /etc/apt/sources.list.d/kubic-libcontainers.list <<< "deb $KUBIC_REPO/$OS/ /"
sudo tee -a /etc/apt/sources.list.d/kubic-libcontainers.list <<< "deb $KUBIC_REPO:/cri-o:/$CRIO_VERSION/$OS/ /"
curl -L $KUBIC_REPO/$OS/Release.key | sudo apt-key add -
curl -L $KUBIC_REPO:/cri-o:/$CRIO_VERSION/$OS/Release.key | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install cri-o cri-o-runc cri-tools hardlink
# Fix libpcre2-posix2 package version, use the
sudo apt-get -y install --reinstall --allow-downgrades libpcre2-posix2/$(lsb_release -cs)
# Also need oras, skopeo ; but they are already installed
bash <(curl -s https://raw.githubusercontent.com/pgrange/bash_unit/master/install.sh)
# Start cri-o service
sudo systemctl start crio
# TODO: cache the installed image?
- name: Unit testing with bash_unit
run: |
export IMAGE="${{ env.DOCKER_IMAGE }}:${{ github.sha }}"
sudo FORCE_COLOR=true ./bash_unit test.sh
# TODO: parse individual tests results (in TAP format)
# - uses: dorny/test-reporter@v1
# if: success() || failure()