diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..13294c6 --- /dev/null +++ b/.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 diff --git a/Makefile b/Makefile index 570f77a..f104872 100644 --- a/Makefile +++ b/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 diff --git a/tests/docker-compose-test-s3.yml b/tests/docker-compose-test-s3.yml index 5537047..b0254c4 100644 --- a/tests/docker-compose-test-s3.yml +++ b/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