From df1568896f8c7c12b4bcef722165bf7f79a50be0 Mon Sep 17 00:00:00 2001 From: David Yang Date: Thu, 12 May 2022 22:49:23 +0800 Subject: [PATCH] Add basic CI to check build --- .github/workflows/ci.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..28b50285a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +# .github/workflows/ci.yml + +name: CI + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Get tag + id: tag + run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/} + + - name: Checkout the current branch + run: | + echo "BRANCH=$(echo $GITHUB_REF | cut -d'/' -f 3)" >> $GITHUB_ENV + git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/* + git fetch --unshallow --tags + git tag + if [[ $(git rev-parse --abbrev-ref HEAD) == "master" ]]; then + echo "reattaching HEAD on master" + git symbolic-ref --short HEAD || git checkout -b ${GITHUB_ENV}-test $GITHUB_ENV + fi + + sudo apt update -q + + - name: Test make + run: | + make + make clean