From 89bccf7796935c105999d5e7cad2d8854b1f49f9 Mon Sep 17 00:00:00 2001 From: max furman Date: Tue, 20 Sep 2022 22:16:46 -0700 Subject: [PATCH] [action] update test and release action to use common workflows --- .github/workflows/release.yml | 38 ++++-------------------------- .github/workflows/test.yml | 44 ++++------------------------------- 2 files changed, 10 insertions(+), 72 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4336472..5cea509d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,41 +7,13 @@ on: - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 jobs: - test: - name: Lint, Test, Build - runs-on: ubuntu-20.04 - strategy: - matrix: - go: [ '1.18', '1.19' ] - outputs: - is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }} - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} - - - name: Install Deps - id: install-deps - run: sudo apt-get -y install libpcsclite-dev - - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - version: ${{ secrets.GOLANGCI_LINT_VERSION }} - args: --timeout=30m - - - name: Test, Build - id: lint_test_build - run: V=1 make ci + ci: + uses: smallstep/workflows/.github/workflows/goCI.yml@main + create_release: name: Create Release - needs: test + needs: ci runs-on: ubuntu-20.04 outputs: debversion: ${{ steps.extract-tag.outputs.DEB_VERSION }} @@ -132,7 +104,7 @@ jobs: build_upload_docker: name: Build & Upload Docker Images runs-on: ubuntu-20.04 - needs: test + needs: ci steps: - name: Checkout diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8a2f391c..b9ab97e9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Lint, Test, Build +name: CI on: push: @@ -7,43 +7,9 @@ on: branches: - "**" pull_request: + schedule: + - cron: '0 0 * * *' jobs: - lintTestBuild: - name: Lint, Test, Build - runs-on: ubuntu-20.04 - strategy: - matrix: - go: [ '1.18', '1.19' ] - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} - - - name: Install Deps - id: install-deps - run: sudo apt-get -y install libpcsclite-dev - - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 - with: - version: ${{ secrets.GOLANGCI_LINT_VERSION }} - args: --timeout=30m - - - name: Test, Build - id: lint_test_build - run: V=1 make ci - - - name: Codecov - if: matrix.go == '1.19' - uses: codecov/codecov-action@v2 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.out # optional - name: codecov-umbrella # optional - fail_ci_if_error: true # optional (default = false) + ci: + uses: smallstep/workflows/.github/workflows/goCI.yml@main