From 959fe9ef9fe51a7b7848bbc1d04da5145783f4da Mon Sep 17 00:00:00 2001 From: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> Date: Wed, 26 May 2021 13:29:48 +0800 Subject: [PATCH] CI: build on all platform (#343) --- .github/workflows/nightly-build.yml | 34 ++++++++++++-------------- .github/workflows/test.yml | 38 +++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 445f316..1f6b776 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -2,16 +2,22 @@ on: push: branches: - master - paths-ignore: - - "**.md" - - "docs/**" + paths: + - "**/*.go" + - "go.mod" + - "go.sum" + - "Makefile" + - ".github/workflows/nightly-build.yml" pull_request: types: [opened, synchronize, reopened] branches: - master - paths-ignore: - - "**.md" - - "docs/**" + paths: + - "**/*.go" + - "go.mod" + - "go.sum" + - "Makefile" + - ".github/workflows/nightly-build.yml" name: nightly-build jobs: build: @@ -19,8 +25,7 @@ jobs: fail-fast: false matrix: go-version: ["1.16"] - platform: [ubuntu-latest, windows-latest, macos-latest] - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest steps: - name: Install Go uses: actions/setup-go@v2 @@ -30,14 +35,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Test - run: make test - - name: Build - run: make - - - name: Upload Binary - uses: actions/upload-artifact@v2 - with: - name: build-${{ matrix.platform }} - path: ./build/ + run: | + make geosite.dat geoip.dat + make release -j$(nproc) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..cd9d717 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,38 @@ +name: Test +on: + push: + branches: + - master + paths: + - "**/*.go" + - "go.mod" + - "go.sum" + - ".github/workflows/test.yml" + pull_request: + types: [opened, synchronize, reopened] + branches: + - master + paths: + - "**/*.go" + - "go.mod" + - "go.sum" + - ".github/workflows/test.yml" +jobs: + test: + strategy: + fail-fast: false + matrix: + go-version: ["1.16"] + platform: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.platform }} + steps: + - name: Install Go + uses: actions/setup-go@v2 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Test + run: make test