diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e9f2ae6..bde0dfb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,30 +1,18 @@ name: Build -on: - push: - pull_request: - branches: ["*"] - tags-ignore: - - build-* - workflow_dispatch: - inputs: - increaseVersion: - description: "increase version - yes/no" - default: "yes" - required: false +on: [pull_request] jobs: - test: - if: ${{ github.event_name != 'push' || contains(github.event.head_commit.message, '#build') || github.ref == 'refs/heads/main' }} + build: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Install Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: 1.18 @@ -34,68 +22,10 @@ jobs: env: GH_ACCESS_TOKEN: ${{ secrets.GH_TOKEN }} - - name: Execute Tests - run: | - go test -v ./... - env: - GOPRIVATE: github.com/argonsecurity/* - - build: - if: ${{ ( github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, '#build') || (github.ref == 'refs/heads/main')) && !contains(github.event.head_commit.message, '#skip-build') }} - needs: [test] - runs-on: ubuntu-latest - steps: - - name: Set Repo Envs + - name: Build run: | - echo "status=failed" | tee -a $GITHUB_ENV - echo "git_repo_name=chain-bench" | tee -a $GITHUB_ENV - - - name: Checkout the repo - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.18 - - - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.9 - with: - versionSpec: "5.6.7" - - - name: Bump Version - if: "${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/master' }}" - run: | - echo "Increasing version" - git config user.name "GitHub Actions Bot" - git config user.email "<>" - - - name: Determine Version - id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.9 - - - name: Set Version - run: | - if [[ "${{ github.event.inputs.increaseVersion}}" != "yes" || ! ${{ github.ref }} =~ refs/heads/(main|master)$ ]]; then - echo "Set GITVERSION by steps.gitversion.outputs.fullSemVer" - GITVERSION=${{ steps.gitversion.outputs.fullSemVer }} - else - echo "Set GITVERSION by Incrementing steps.gitversion.outputs.fullSemVer" - GITVERSION=${GitVersion_Major}.${GitVersion_Minor}.$((GitVersion_Patch+1)) - fi - echo "gitversion=${GITVERSION}" | tee -a $GITHUB_ENV - - - name: Commit Tag and Push - env: - TAG: ${{ env.gitversion }} - run: | - git tag "${TAG}" || true - git push --tags || true - - - name: Configure git url + make + + - name: Execute Tests run: | - git config --global url.https://$GH_ACCESS_TOKEN@github.com/.insteadOf https://github.com/ - env: - GH_ACCESS_TOKEN: ${{ secrets.GH_TOKEN }} + make test