diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..441e152 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,23 @@ +--- +kind: pipeline +name: amd64 + +platform: + os: linux + arch: amd64 + +steps: + + - name: prepare repo + image: clux/muslrust:1.61.0 + user: root + commands: + - git fetch --tags + - git submodule init + - git submodule update --recursive --remote + - chown 1000:1000 . -R + + - name: check with different features + image: clux/muslrust:1.61.0 + commands: + - cd test/hypercrate && cargo build diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 0000000..216154f --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,34 @@ +name: integration +on: + pull_request: + branches: + - 'main' + +jobs: + docker: + name: 'Integration tests' + runs-on: 'ubuntu-latest' + steps: + - uses: 'actions/checkout@v2' + - uses: extractions/setup-just@v1 + + - name: Build stable image + uses: docker/build-push-action@v2 + with: + context: . + push: false + build-args: | + CHANNEL=stable + tags: clux/muslrust:temp + + - name: Compute rustc version + shell: bash + run: docker run clux/muslrust:temp rustc --version + + - name: Verify we can run git fetch + shell: bash + run: docker run -v $PWD:/volume -w /volume -t clux/muslrust:temp git config --global --add safe.directory /volume && git fetch --tags + + - name: Verify we can docker build in builder pattern + shell: bash + run: docker build --build-arg CRATE="hypercrate" -f test/Dockerfile.test -t clux/muslrust-tests:temp test/ diff --git a/justfile b/justfile index fcc0ede..0857dd7 100644 --- a/justfile +++ b/justfile @@ -12,9 +12,15 @@ build-nightly: (_build "nightly") # Shell into the built container run: - docker run -v $PWD/test:/volume -w /volume -it clux/muslrust:temp /bin/bash + docker run -v $PWD:/volume -w /volume -it clux/muslrust:temp /bin/bash -# Test an individual crate against built containr +_i crate: + docker build --build-arg CRATE="{{crate}}crate" -f test/Dockerfile.test -t clux/muslrust-tests:temp test/ + +# Test builder pattern and building a copied crate in a builder +integration: (_i "hyper") + +# Test an individual crate against built container _t crate: ./test.sh {{crate}} diff --git a/test/Dockerfile.test b/test/Dockerfile.test new file mode 100644 index 0000000..c843c11 --- /dev/null +++ b/test/Dockerfile.test @@ -0,0 +1,14 @@ +FROM clux/muslrust:temp as builder + +# Test a blank crate +WORKDIR / +RUN cargo new --bin api +WORKDIR /api +RUN cargo build --release + +# Test a particular crate +ARG CRATE +COPY ${CRATE} /app +WORKDIR /app +RUN ls /app/* +RUN cargo build --release