-
Notifications
You must be signed in to change notification settings - Fork 88
51 lines (51 loc) · 1.43 KB
/
build.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
name: Build test and push
on:
pull_request:
workflow_dispatch:
push:
branches:
- master
permissions:
contents: read
packages: write
jobs:
build-test-push:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: get thumbor version
id: thumbor
run: |
echo "VERSION=$(cat thumbor/requirements.txt| grep thumbor== | cut -d= -f 3)" >> $GITHUB_OUTPUT
- name: build images and load them for testing
run: |
./build
- name: install bats
run: |
git clone https://github.com/bats-core/bats-core.git
cd bats-core
sudo ./install.sh /usr/local
- name: run bats tests
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: |
docker image ls -a
for filename in tests/*.bats; do sudo bats --tap "$filename" || exit 1; done
- name: login to ghcr.io
if: github.ref == 'refs/heads/master'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: minimalcompact
password: ${{ secrets.GH_TOKEN }}
- name: push when master
if: github.ref == 'refs/heads/master'
run: |
./push