Add tests

This commit is contained in:
ViViDboarder 2021-06-15 10:52:16 -07:00
parent 04825619ae
commit fd824fbf47
3 changed files with 35 additions and 2 deletions

30
.github/workflows/tests.yml vendored Normal file
View File

@ -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

View File

@ -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

View File

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