From 944f87876a6ec54566f8686315943551039b43bd Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Thu, 2 Dec 2021 08:45:26 +0000 Subject: [PATCH] Move to shared build workflow. --- .github/workflows/test.yaml | 68 ++++--------------------------------- 1 file changed, 6 insertions(+), 62 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e54cb09..0b44a30 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,65 +9,9 @@ on: - "*" jobs: - prepare: - name: Preparing build context - runs-on: ubuntu-latest - outputs: - RELEASE_VERSION: ${{ steps.semver.outputs.semantic_version }} - steps: - - name: Checkout repo - uses: actions/checkout@v2 - with: - fetch-depth: '0' - - name: Semver run - id: semver - uses: lukaszraczylo/semver-generator@v1 - with: - config_file: semver.yaml - repository_local: true - - tests: - name: Run unit tests - runs-on: ubuntu-latest - container: golang:1-buster - env: - CI: true - steps: - - name: Checkout repo - uses: actions/checkout@v2 - - name: Setup GoLang - uses: actions/setup-go@v2 - with: - stable: 'true' - - name: Test code - run: | - git config --global url."https://${{ secrets.GHCR_TOKEN }}:x-oauth-basic@github.com/${{ github.repository_owner }}".insteadOf "https://github.com/${{ github.repository_owner }}"; - make test CI_RUN=${CI} - - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos - files: coverage.out - - release: - name: Create Release - runs-on: ubuntu-latest - needs: [ prepare, tests ] - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Get list of the commits since last release - run: | - echo "$(git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%h %s")" > .release_notes - - name: Create Release - id: create_release - uses: actions/create-release@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: v${{ needs.prepare.outputs.RELEASE_VERSION }} - release_name: v${{ needs.prepare.outputs.RELEASE_VERSION }} - body_path: .release_notes - draft: false - prerelease: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/main' }} \ No newline at end of file + shared: + uses: telegram-bot-app/ci-scripts/.github/workflows/library-test-publish.yaml@main + with: + enable-code-scans: true + secrets: + ghcr-token: ${{ secrets.GHCR_TOKEN }} \ No newline at end of file