From f40d65e5ec18e3c90491667733f8552d56af88a0 Mon Sep 17 00:00:00 2001 From: Rahix Date: Fri, 5 Feb 2021 22:15:20 +0100 Subject: [PATCH] ci: Switch to GitHub Actions --- .github/workflows/ci.yml | 73 ++++++++++++++++++++++++++++++++++++++++ .travis.yml | 27 --------------- README.md | 2 +- 3 files changed, 74 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..cd47f6dc5fc93ea6d04dd9379da76042c4c1ab72 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,73 @@ +name: Continuous Integration + +on: + - push + - pull_request + +jobs: + ci: + name: "Test-build avr-device with all targets and runtime enabled" + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly-2021-01-07 + override: true + components: rustfmt + + # Python Dependencies + - name: Install Python dependencies + run: | + pip3 install --user setuptools wheel + pip3 install --user svdtools + - name: Put pip binary directory into path + run: echo "$HOME/.local/bin" >> $GITHUB_PATH + + # Rust Dependencies + - name: Cache Cargo installed binaries + uses: actions/cache@v1 + id: cache-cargo + with: + path: ~/cargo-bin + key: rust-tools-001 + - name: Install svd2rust + if: steps.cache-cargo.outputs.cache-hit != 'true' + run: | + mkdir svd2rust + cd svd2rust + git init + git remote add origin https://github.com/rust-embedded/svd2rust.git + git fetch origin 56be78729279eeebef65110c13be8d96c0b9270f + git checkout FETCH_HEAD + cargo install --path . + - name: Install cargo-form + if: steps.cache-cargo.outputs.cache-hit != 'true' + uses: actions-rs/install@v0.1 + with: + crate: form + version: 0.7.0 + - name: Install atdf2svd + if: steps.cache-cargo.outputs.cache-hit != 'true' + uses: actions-rs/install@v0.1 + with: + crate: atdf2svd + version: 0.2.0 + - name: Copy tools to cache directory + if: steps.cache-cargo.outputs.cache-hit != 'true' + run: | + mkdir ~/cargo-bin + cp ~/.cargo/bin/svd2rust ~/cargo-bin + cp ~/.cargo/bin/form ~/cargo-bin + cp ~/.cargo/bin/atdf2svd ~/cargo-bin + - name: Put new cargo binary directory into path + run: echo "$HOME/cargo-bin" >> $GITHUB_PATH + + # Actual test run + - name: Generate chip description sources + run: make RUSTUP_TOOLCHAIN=nightly-2021-01-07 + - name: Test-compile the crate + run: cargo check --all-features diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c31dd1de845e69db8157976e9d1022b044c32490..0000000000000000000000000000000000000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: rust -rust: - - nightly-2020-10-25 - -cache: - cargo: true - pip: true - directories: - - /opt/pyenv - - ~/svd2rust - -install: - - pyenv install 3.6.3 - - pyenv global 3.6.3 - - python3 -c "__import__('svdtools')" || pip3 install --user svdtools - - rustup component add rustfmt - - cargo install form || true - # TODO: Hack to use the latest version of svd2rust - # - cargo install svd2rust || true - - ! test -d svd2rust || (mkdir svd2rust && cd svd2rust && git init && git remote add origin https://github.com/rust-embedded/svd2rust.git) - - (cd svd2rust && git fetch origin 56be78729279eeebef65110c13be8d96c0b9270f && git checkout FETCH_HEAD && cargo install --path .) - - cargo install atdf2svd || true - -script: - - pyenv global 3.6.3 - - make RUSTUP_TOOLCHAIN=nightly-2020-10-25 - - cargo build --all-features diff --git a/README.md b/README.md index f7d419633711635b3efb319f0e93138e74068b36..147ce8ee3f86baa31527c6607abc8212ce435484 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -avr-device [![crates.io page](http://meritbadge.herokuapp.com/avr-device)](https://crates.io/crates/avr-device) [![docs.rs](https://docs.rs/avr-device/badge.svg)](https://docs.rs/avr-device) [![Build Status](https://travis-ci.com/Rahix/avr-device.svg?branch=master)](https://travis-ci.com/Rahix/avr-device) +avr-device [![crates.io page](http://meritbadge.herokuapp.com/avr-device)](https://crates.io/crates/avr-device) [![docs.rs](https://docs.rs/avr-device/badge.svg)](https://docs.rs/avr-device) ![Continuous Integration](https://github.com/Rahix/avr-device/workflows/Continuous%20Integration/badge.svg) ========== Auto-generated wrappers around registers for AVR microcontrollers.