Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration tests running git fetch #100

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -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/
10 changes: 8 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}}

Expand Down
14 changes: 14 additions & 0 deletions test/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -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