From 28af7eb5963bf43edb4e7b0790bc9a9cf1ac9b70 Mon Sep 17 00:00:00 2001 From: Constantine Bitensky Date: Thu, 8 Jul 2021 16:08:21 +0300 Subject: [PATCH] Add stability-fast action to pull requests (#1791) * Add stability-fast action to pull requests * Add stability-fast action to pull requests * Add stability-fast action to pull requests * Add stability-fast action to pull requests * Add stability-fast action to pull requests * Add stability-fast action to pull requests * Add stability-fast action to pull requests * Add stability-fast action to pull requests * Add stability-fast action to pull requests --- .../workflows/{go-deploy.yml => deploy.yaml} | 25 ++++---- .github/workflows/{go-race.yml => race.yaml} | 8 +-- .github/workflows/stability-fast.yml | 31 ---------- .github/workflows/{go.yml => tests.yaml} | 61 +++++++++++++------ 4 files changed, 59 insertions(+), 66 deletions(-) rename .github/workflows/{go-deploy.yml => deploy.yaml} (73%) rename .github/workflows/{go-race.yml => race.yaml} (92%) delete mode 100644 .github/workflows/stability-fast.yml rename .github/workflows/{go.yml => tests.yaml} (51%) diff --git a/.github/workflows/go-deploy.yml b/.github/workflows/deploy.yaml similarity index 73% rename from .github/workflows/go-deploy.yml rename to .github/workflows/deploy.yaml index 25261037b..4e584fa1c 100644 --- a/.github/workflows/go-deploy.yml +++ b/.github/workflows/deploy.yaml @@ -1,4 +1,4 @@ -name: Build and Upload assets +name: Build and upload assets on: release: types: [published] @@ -10,31 +10,30 @@ jobs: fail-fast: false matrix: os: [ ubuntu-latest, windows-latest, macos-latest ] - name: Building For ${{ matrix.os }} + name: Building, ${{ matrix.os }} steps: - - name: Fix windows CRLF + - name: Fix CRLF on Windows + if: runner.os == 'Windows' run: git config --global core.autocrlf false - name: Check out code into the Go module directory uses: actions/checkout@v2 - # We need to increase the page size because the tests run out of memory on github CI windows. - # Use the powershell script from this github action: https://github.com/al-cheb/configure-pagefile-action/blob/master/scripts/SetPageFileSize.ps1 - # MIT License (MIT) Copyright (c) 2020 Maxim Lobanov and contributors - - name: Increase page size on windows + # Increase the pagefile size on Windows to aviod running out of memory + - name: Increase pagefile size on Windows if: runner.os == 'Windows' - shell: powershell - run: powershell -command .\.github\workflows\SetPageFileSize.ps1 + run: powershell -command .github\workflows\SetPageFileSize.ps1 - - name: Set up Go 1.x + - name: Setup Go uses: actions/setup-go@v2 with: go-version: 1.16 - - name: Build on linux + - name: Build on Linux if: runner.os == 'Linux' - # `-extldflags=-static` - means static link everything, `-tags netgo,osusergo` means use pure go replacements for "os/user" and "net" + # `-extldflags=-static` - means static link everything, + # `-tags netgo,osusergo` means use pure go replacements for "os/user" and "net" # `-s -w` strips the binary to produce smaller size binaries run: | go build -v -ldflags="-s -w -extldflags=-static" -tags netgo,osusergo -o ./bin/ ./... @@ -66,7 +65,7 @@ jobs: echo "asset_name=${asset_name}" >> $GITHUB_ENV - - name: Upload Release Asset + - name: Upload release asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/go-race.yml b/.github/workflows/race.yaml similarity index 92% rename from .github/workflows/go-race.yml rename to .github/workflows/race.yaml index 50340d35b..b992b7b15 100644 --- a/.github/workflows/go-race.yml +++ b/.github/workflows/race.yaml @@ -1,4 +1,4 @@ -name: Go-Race +name: Race on: schedule: @@ -7,7 +7,7 @@ on: jobs: race_test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: @@ -19,10 +19,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Go 1.x + - name: Setup Go uses: actions/setup-go@v2 with: - go-version: 1.15 + go-version: 1.16 - name: Set scheduled branch name shell: bash diff --git a/.github/workflows/stability-fast.yml b/.github/workflows/stability-fast.yml deleted file mode 100644 index 88eaf9022..000000000 --- a/.github/workflows/stability-fast.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Fast stability tests - -on: - push: - -jobs: - stability-test-fast: - runs-on: ubuntu-20.04 - name: Fast stability tests on ${{ github.ref }} - steps: - - - name: Set up Go 1.16 - uses: actions/setup-go@v2 - with: - go-version: 1.16 - - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Install kaspad - run: go install ./... - - - name: Install golint - run: go get -u golang.org/x/lint/golint - - - name: Run fast stability test - timeout-minutes: 720 - working-directory: stability-tests - run: ./install_and_test.sh diff --git a/.github/workflows/go.yml b/.github/workflows/tests.yaml similarity index 51% rename from .github/workflows/go.yml rename to .github/workflows/tests.yaml index b500f44df..06b87f027 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/tests.yaml @@ -1,38 +1,36 @@ -name: Go +name: Tests on: push: pull_request: - # edtited - "title, body, or the base branch of the PR is modified" - # synchronize - "commit(s) pushed to the pull request" - types: [opened, synchronize, edited, reopened] + # edtited - because base branch can be modified + # synchronize - update commits on PR + types: [opened, synchronize, edited] jobs: + build: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ ubuntu-16.04, macos-10.15, windows-2019 ] - name: Testing on on ${{ matrix.os }} + os: [ ubuntu-latest, macos-latest, windows-latest ] + name: Tests, ${{ matrix.os }} steps: - - name: Fix windows CRLF + - name: Fix CRLF on Windows + if: runner.os == 'Windows' run: git config --global core.autocrlf false - name: Check out code into the Go module directory uses: actions/checkout@v2 - # We need to increase the page size because the tests run out of memory on github CI windows. - # Use the powershell script from this github action: https://github.com/al-cheb/configure-pagefile-action/blob/master/scripts/SetPageFileSize.ps1 - # MIT License (MIT) Copyright (c) 2020 Maxim Lobanov and contributors - - name: Increase page size on windows + # Increase the pagefile size on Windows to aviod running out of memory + - name: Increase pagefile size on Windows if: runner.os == 'Windows' - shell: powershell - run: powershell -command .\.github\workflows\SetPageFileSize.ps1 + run: powershell -command .github\workflows\SetPageFileSize.ps1 - - - name: Set up Go 1.x + - name: Setup Go uses: actions/setup-go@v2 with: go-version: 1.16 @@ -51,14 +49,41 @@ jobs: shell: bash run: ./build_and_test.sh -v + + stability-test-fast: + runs-on: ubuntu-latest + name: Fast stability tests, ${{ github.head_ref }} + steps: + + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install kaspad + run: go install ./... + + - name: Install golint + run: go get -u golang.org/x/lint/golint + + - name: Run fast stability tests + working-directory: stability-tests + run: ./install_and_test.sh + + coverage: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest name: Produce code coverage steps: - name: Check out code into the Go module directory uses: actions/checkout@v2 - - name: Set up Go 1.x + - name: Setup Go uses: actions/setup-go@v2 with: go-version: 1.16 @@ -70,4 +95,4 @@ jobs: run: go test -v -covermode=atomic -coverpkg=./... -coverprofile coverage.txt ./... - name: Upload coverage file - run: bash <(curl -s https://codecov.io/bash) \ No newline at end of file + run: bash <(curl -s https://codecov.io/bash)