Skip to content

Commit

Permalink
Try #609:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Nov 18, 2021
2 parents 2f1ef07 + 368e2ec commit 15d9909
Show file tree
Hide file tree
Showing 19 changed files with 474 additions and 243 deletions.
2 changes: 1 addition & 1 deletion .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
block_labels = ["needs-decision"]
delete_merged_branches = true
required_approvals = 1
status = ["rust-embedded.cross", "shellcheck"]
status = ["Docker Build", "CI"]
timeout_sec = 21600
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,52 @@ on: [pull_request, push]
name: CI

jobs:
ci:
name: CI
needs: [shellcheck, test, fmt]
runs-on: ubuntu-latest
steps:
- name: I Complete
run: exit 0
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: ShellCheck
uses: azohra/[email protected]
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.42.0
profile: minimal
components: clippy
- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: test
args: --locked
timeout-minutes: 5
- name: Run clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --locked
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.42.0
profile: minimal
components: rustfmt
- name: rustfmt -- --check
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
290 changes: 290 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
on:
push:
branches: [master, staging, trying]
tags:
- "v*.*.*"

name: Docker Build

jobs:
docker-build:
needs: [docker-builds]
runs-on: ubuntu-latest
steps:
- name: Docker builds done
run: exit 0
docker-builds:
name: Docker Build
runs-on: ${{ matrix.image }}
env:
CARGO_NET_RETRY: 3
CARGO_HTTP_CHECK_REVOKE: false
strategy:
fail-fast: false
matrix:
toolchain: [1.42.0]
image: [ubuntu-latest]
include:
- target: aarch64-unknown-linux-gnu
cpp: 1
dylib: 1
std: 1
run: 1
runners: qemu-user qemu-system
- target: arm-unknown-linux-gnueabi
cpp: 1
dylib: 1
std: 1
run: 1
- target: arm-unknown-linux-gnueabihf
cpp: 1
dylib: 1
std: 1
run: 1
- target: armv7-unknown-linux-gnueabihf
cpp: 1
dylib: 1
std: 1
run: 1
runners: qemu-user qemu-system
- target: i586-unknown-linux-gnu
cpp: 1
dylib: 1
std: 1
run: 1
- target: i686-unknown-linux-gnu
cpp: 1
dylib: 1
std: 1
run: 1
runners: native qemu-user qemu-system
- target: mips-unknown-linux-gnu
cpp: 1
dylib: 1
std: 1
run: 1
runners: qemu-user qemu-system
- target: mipsel-unknown-linux-gnu
cpp: 1
dylib: 1
std: 1
run: 1
runners: qemu-user qemu-system
- target: mips64-unknown-linux-gnuabi64
cpp: 1
dylib: 1
std: 1
run: 1
- target: mips64el-unknown-linux-gnuabi64
cpp: 1
dylib: 1
std: 1
run: 1
runners: qemu-user qemu-system
- target: powerpc-unknown-linux-gnu
cpp: 1
dylib: 1
std: 1
run: 1
runners: qemu-user qemu-system
- target: powerpc64-unknown-linux-gnu
cpp: 1
dylib: 1
std: 1
run: 1
runners: qemu-user qemu-system
- target: powerpc64le-unknown-linux-gnu
cpp: 1
dylib: 1
std: 1
run: 1
runners: qemu-user qemu-system
- target: riscv64gc-unknown-linux-gnu
cpp: 1
std: 1
run: 1
- target: s390x-unknown-linux-gnu
cpp: 1
dylib: 1
std: 1
run: 1
runners: qemu-system
- target: sparc64-unknown-linux-gnu
cpp: 1
dylib: 1
std: 1
run: 1
runners: qemu-system
- target: x86_64-unknown-linux-gnu
cpp: 1
dylib: 1
std: 1
run: 1
runners: native qemu-user qemu-system
deploy: 1
CRATES_IO_PUBLISH: 1
- target: aarch64-unknown-linux-musl
std: 1
run: 1
- target: arm-unknown-linux-musleabihf
std: 1
run: 1
- target: arm-unknown-linux-musleabi
std: 1
run: 1
- target: armv5te-unknown-linux-gnueabi
std: 1
run: 1
- target: armv5te-unknown-linux-musleabi
std: 1
run: 1
- target: armv7-unknown-linux-musleabihf
std: 1
run: 1
- target: i586-unknown-linux-musl
std: 1
run: 1
- target: i686-unknown-linux-musl
std: 1
run: 1
- target: mips-unknown-linux-musl
cpp: 1
std: 1
run: 1
- target: mipsel-unknown-linux-musl
cpp: 1
std: 1
run: 1
- target: x86_64-unknown-linux-musl
std: 1
run: 1
deploy: 1
- target: aarch64-linux-android
cpp: 1
std: 1
run: 1
- target: arm-linux-androideabi
cpp: 1
std: 1
run: 1
- target: armv7-linux-androideabi
cpp: 1
std: 1
run: 1
- target: i686-linux-android
cpp: 1
std: 1
run: 1
- target: x86_64-linux-android
cpp: 1
std: 1
run: 1
- target: x86_64-apple-darwin
cpp: 1
dylib: 1
std: 1
run: 1
image: macos-latest
deploy: 1
- target: x86_64-pc-windows-gnu
cpp: 1
std: 1
run: 1
- target: i686-pc-windows-gnu
cpp: 1
std: 1
run: 1
- target: x86_64-unknown-dragonfly
cpp: 1
dylib: 1
toolchain: nightly
- target: i686-unknown-freebsd
dylib: 1
std: 1
- target: x86_64-unknown-freebsd
dylib: 1
std: 1
- target: x86_64-unknown-netbsd
cpp: 1
dylib: 1
std: 1
- target: sparcv9-sun-solaris
cpp: 1
dylib: 1
std: 1
- target: x86_64-sun-solaris
cpp: 1
dylib: 1
std: 1
- target: asmjs-unknown-emscripten
std: 1
run: 1
# `cargo run` fails with an assertion error (https://github.com/rust-lang/cargo/issues/4689) on `wasm32-unknown-emscripten`.
- target: wasm32-unknown-emscripten
std: 1
- target: thumbv6m-none-eabi
std: 1
- target: thumbv7em-none-eabi
std: 1
- target: thumbv7em-none-eabihf
std: 1
- target: thumbv7m-none-eabi
std: 1
- target: x86_64-pc-windows-msvc
cpp: 1
std: 1
run: 1
image: windows-latest
deploy: 1

steps:
- uses: actions/checkout@v2
- name: install rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
default: true
profile: minimal
- run: echo "OS=${{ runner.os }}" >> $GITHUB_ENV
- run: echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/heads/')
- run: echo "TAG=${{ runner.os }}" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags/')
- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: test
args: --locked
timeout-minutes: 5
- name: Build Docker image
if: runner.os == 'Linux'
timeout-minutes: 360
env:
TARGET: ${{ matrix.target }}
CPP: ${{ matrix.cpp }}
DYLIB: ${{ matrix.dylib }}
STD: ${{ matrix.std }}
RUN: ${{ matrix.run }}
RUNNERS: ${{ matrix.runners }}
run: ./build-docker-image.sh "${{ matrix.target }}"
- name: Test
run: ./ci/test.sh
- name: Publish on crates.io
if: startsWith(env.TAG, 'v') && matrix.CRATES_IO_PUBLISH == '1'
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
uses: actions-rs/cargo@v1
with:
command: publish
args: --dry-run
- name: Create GitHub Release
if: startsWith(env.TAG, 'v') && env.DEPLOY == '1'
# TODO: Not sure what package to use for this step.
run: echo "TODO"; exit 1
- name: Login to GHCR
if: (env.BRANCH == 'master' || startsWith(env.TAG, 'v')) && runner.os == 'Linux'
run: echo "${ secrets.GITHUB_TOKEN }" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
- name: Push image to GHCR
if: (env.BRANCH == 'master' || startsWith(env.TAG, 'v')) && runner.os == 'Linux'
run: ./ci/docker_push.sh
Loading

0 comments on commit 15d9909

Please sign in to comment.