Browse Source

Add tests

github-tests
ViViDboarder 3 months ago
parent
commit
fd824fbf47
  1. 30
      .github/workflows/tests.yml
  2. 4
      Makefile
  3. 3
      tests/docker-compose-test-s3.yml

30
.github/workflows/tests.yml

@ -0,0 +1,30 @@
---
name: tests
"on":
push:
pull_request:
branches:
- master
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run base tests
run: make test-x86
- name: Run s3 tests
run: make test-s3-x86
- name: Setup python
uses: actions/setup-python@v2.2.2
- name: Run pre-commit hooks
run: |
pip install pre-commit
make check

4
Makefile

@ -11,7 +11,7 @@ test: test-x86
.PHONY: build-x86
build-x86:
docker build -f ./Dockerfile -t $(DOCKER_TAG) .
docker build --build-arg TARGETARCH=amd64 -f ./Dockerfile -t $(DOCKER_TAG) .
.PHONY: build-arm
build-arm:
@ -35,7 +35,7 @@ test-all: test-x86 test-arm
.PHONY: test-s3-x86
test-s3-x86:
cd tests && ./test-s3.sh
cd tests && env TARGETARCH=amd64 ./test-s3.sh
.PHONY: shell-x86
shell-x86: build-x86

3
tests/docker-compose-test-s3.yml

@ -1,9 +1,12 @@
---
version: '2'
services:
restic:
build:
context: ..
dockerfile: Dockerfile
args:
- TARGETARCH
entrypoint: "bash"
command: "-c 'sleep 2 && /test.sh'"
hostname: itest

Loading…
Cancel
Save