This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
First Commit #1
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
# Copyright(c) The Maintainers of Nanvix. | |
# Licensed under the MIT License. | |
name: Build and Test | |
on: push | |
env: | |
TARGET_BRANCH: ${{ github.ref_name }} | |
jobs: | |
setup: | |
name: Setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.hostname }} | |
username: ${{ secrets.username }} | |
key: ${{ secrets.sshkey }} | |
port: ${{ secrets.portnum }} | |
envs: TARGET_BRANCH | |
script: | | |
rm -rf allocator | |
git clone --recursive https://github.com/nanvix/allocator.git --branch ${TARGET_BRANCH} | |
build: | |
name: Build | |
needs: setup | |
runs-on: ubuntu-latest | |
steps: | |
- name: Build | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.hostname }} | |
username: ${{ secrets.username }} | |
key: ${{ secrets.sshkey }} | |
port: ${{ secrets.portnum }} | |
script: | | |
source "$HOME/.cargo/env" | |
cd allocator | |
cargo build --verbose | |
test: | |
name: Test | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: test | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.hostname }} | |
username: ${{ secrets.username }} | |
key: ${{ secrets.sshkey }} | |
port: ${{ secrets.portnum }} | |
script: | | |
source "$HOME/.cargo/env" | |
cd allocator | |
cargo test --verbose | |
cleanup: | |
name: Cleanup | |
needs: test | |
if: always() | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cleanup | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.hostname }} | |
username: ${{ secrets.username }} | |
key: ${{ secrets.sshkey }} | |
port: ${{ secrets.portnum }} | |
script: | | |
cd allocator | |
git checkout --force dev | |
git clean -fdx | |
git remote prune origin |