diff --git a/.woodpecker/Dockerfile b/.woodpecker/Dockerfile new file mode 100644 index 0000000..4fc4865 --- /dev/null +++ b/.woodpecker/Dockerfile @@ -0,0 +1,15 @@ +FROM alpine:3.14 + +RUN apk update +RUN apk upgrade +RUN apk add rustup postgresql shadow bash gcc clang build-base + +RUN useradd -ms /bin/bash test + +USER test +WORKDIR /home/test +SHELL ["/bin/bash", "-c"] + +RUN rustup-init -y +ENV HOME="/home/test" +ENV PATH="/home/test/.cargo/bin:$PATH" diff --git a/.woodpecker/all_push.yml b/.woodpecker/all_push.yml new file mode 100644 index 0000000..d8dba6a --- /dev/null +++ b/.woodpecker/all_push.yml @@ -0,0 +1,15 @@ +# Always run build and unit tests +steps: + - name: build + image: git.firechicken.net/fedichat/rust_builder:latest + pull: true + commands: + - cargo build + depends_on: [] + + - name: test + image: git.firechicken.net/fedichat/rust_builder:latest + pull: true + commands: + - cargo test + depends_on: [] diff --git a/.woodpecker/master_push.yml b/.woodpecker/master_push.yml new file mode 100644 index 0000000..db6ec13 --- /dev/null +++ b/.woodpecker/master_push.yml @@ -0,0 +1,32 @@ +# do a rebuild whenever we push to master and make sure tests still pass +# eventually this should also do integration tests + +when: + - event: push + branch: master + +steps: + - name: docker-build + image: woodpeckerci/plugin-kaniko + settings: + dockerfile: .woodpecker/Dockerfile + registry: git.firechicken.net + repo: fedichat/rust_builder + username: + from_secret: OCI_USER + password: + from_secret: OCI_TOKEN + + - name: build + image: git.firechicken.net/fedichat/rust_builder:latest + pull: true + commands: + - cargo build + depends_on: [docker-build] + + - name: test + image: git.firechicken.net/fedichat/rust_builder:latest + pull: true + commands: + - cargo test + depends_on: [docker-build]