From a3f0a4ef6ef19ffc62a59fa03a6e6367c106c33b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Thu, 4 Apr 2024 21:06:13 +0900 Subject: [PATCH] feat(ci): add test on push --- .github/workflows/release.yml | 3 ++- .github/workflows/test.yml | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e99f54..cc5d350 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ env: GITHUB_TOKEN: ${{ github.token }} jobs: - my-job: + release: name: Build on Push Tag ๐Ÿš€ runs-on: ubuntu-latest steps: @@ -27,6 +27,7 @@ jobs: run: | gcc -g -Os -static -nostdlib -nostdinc -fno-pie -no-pie -mno-red-zone \ -fno-omit-frame-pointer -pg -mnop-mcount -D__cosmopolitan \ + -DBASE16384_VERSION="${{ github.ref }}" -DBASE16384_VERSION_DATE="`date +"%Y%b/%d"`"\ -o base16384.com.dbg base16384.c file.c base1432.c -fuse-ld=bfd -Wl,-T,ape.lds \ -include cosmopolitan.h crt.o ape.o cosmopolitan.a objcopy -S -O binary base16384.com.dbg base16384.com diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..0836093 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: test +on: [ push ] + +jobs: + test: + name: Run CMake Test ๐Ÿงช + runs-on: ubuntu-latest + steps: + + - name: Check out code + uses: actions/checkout@v2 + + - name: Set up Build tools + run: | + sudo apt-get update + sudo apt-get install -y gcc cmake + + - name: Build and Run Tests + run: | + mkdir build + cd build + cmake -DBUILD=test .. + make + make test