ci: prepare for using fedora image based ci #42
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Cargo Build | |
on: | |
push: | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
FEDORA_LINK: https://ftp-nyc.osuosl.org/pub/fedora/linux/releases/38/Cloud/x86_64/images/Fedora-Cloud-Base-38-1.6.x86_64.qcow2 | |
jobs: | |
build: | |
name: Rust project - latest | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
toolchain: | |
- stable | |
- beta | |
- nightly | |
steps: | |
- uses: actions/checkout@v3 | |
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} | |
- run: cargo build --verbose | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
steps: | |
- name: "install: mkosi + dependencies" | |
shell: bash | |
run: | | |
sudo apt update -o Acquire::Retries=3 | |
sudo apt install -y dnf rpm qemu-system-x86 ovmf e2fsprogs btrfs-progs wget git \ | |
qemu-utils genisoimage make sshpass unzip lynx bc openssl \ | |
flex bison time util-linux | |
- name: "acquire: libublk" | |
uses: actions/checkout@v3 | |
- name: "Cache Fedora image" | |
id: cache-fedora | |
uses: actions/cache@v3 | |
with: | |
path: ~/images | |
key: fedora-image-key | |
- name: "Generate Fedora Image" | |
working-directory: ci | |
if: steps.cache-fedora.outputs.cache-hit != 'true' | |
run: | | |
pwd | |
ls -la | |
[ ! -d ~/images ] && mkdir ~/images | |
./setup-simple-image $FEDORA_LINK 10 ~/images | |
- name: "Run libublk-rs test" | |
shell: bash | |
run: ci/prep-test 10 ~/images $(pwd) | |
- name: Upload libublk test log | |
uses: actions/upload-artifact@v3 | |
with: | |
name: test_log | |
path: | | |
console.log | |
libublk-rs.log | |
- name: "cleanup" | |
if: always() | |
continue-on-error: true | |
run: | | |
#cat ${{ github.workspace }}/qemu.log | |
sudo pkill -f qemu |