From b02658aabfb057b7db642e628952432255bfc491 Mon Sep 17 00:00:00 2001 From: Garfield Lee Date: Wed, 17 Jan 2024 12:14:40 +0800 Subject: [PATCH] ci: add build and test workflow --- .github/workflows/build-and-test.yml | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/build-and-test.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..9ff7163 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,46 @@ +name: Build and test + +on: + push: + branches: + - main + paths-ignore: + - .editorconfig + - .gitattributes + - .gitignore + - LICENSE + - README.md + - .github/** + - '!.github/workflows/build-and-test.yml' + - .vscode/** + pull_request: + paths-ignore: + - .editorconfig + - .gitattributes + - .gitignore + - LICENSE + - README.md + - .github/** + - '!.github/workflows/build-and-test.yml' + - .vscode/** + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-and-test: + name: Build zig project and run tests + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup zig + uses: goto-bus-stop/setup-zig@v2 + + - name: Lint + run: zig fmt --check . + + - name: Build and test + run: zig build test