Maintanance 2023-07-06 #329
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build PR | |
on: | |
pull_request: | |
jobs: | |
generate_infos: | |
uses: fullstack-devops/git-workflows/.github/workflows/generate-build-infos.yml@main | |
secrets: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
build: | |
runs-on: ubuntu-latest | |
needs: generate_infos | |
steps: | |
- run: export | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.19 | |
- name: Build | |
run: make | |
env: | |
VERSION: "${{ needs.generate_infos.outputs.version }}" | |
- name: Test | |
run: make test | |
- name: debugging git | |
run: | | |
echo "git name-rev HEAD: $(git name-rev HEAD)" | |
echo "git log -1 --pretty=format:"%s": $(git log -1 --pretty=format:"%s")" | |
echo "git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@': $(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')" | |
- name: test build Infos | |
run: build/package/awesome-ci_${{ needs.generate_infos.outputs.version }}_linux-amd64 pr info -n ${{ github.event.pull_request.number }} -v > $GITHUB_STEP_SUMMARY | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: test env file | |
run: export | grep ACI_ | |
- name: create changelog & update release-template.md | |
run: make chglog | |
env: | |
LATEST_VERSION: "${{ needs.generate_infos.outputs.latest-version }}" | |
- name: Cache build outputs | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-outputs-modules | |
with: | |
path: build/package/ | |
key: awesome-ci-${{ github.event.pull_request.head.sha }}-${{ hashFiles('build/package/awesome-ci*') }} | |
restore-keys: | | |
awesome-ci-${{ github.event.pull_request.head.sha }} | |
create_release_test: | |
runs-on: ubuntu-latest | |
needs: [generate_infos, build] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: get cached build outputs | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-outputs-modules | |
with: | |
path: build/package/ | |
key: awesome-ci-${{ github.event.pull_request.head.sha }} | |
- name: get generated artifacts | |
working-directory: build/package | |
run: | | |
ls -la | |
cat release-template.md |