name: release on: workflow_run: workflows: [test] branches: [master] types: [completed] jobs: release: runs-on: ubuntu-20.04 # need to manually check for a couple things # - tests passed? # - we are the most recent commit on master? if: ${{github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_sha == github.sha}} steps: - uses: actions/checkout@v2 with: ref: ${{github.event.workflow_run.head_sha}} # need workflow access since we push branches # containing workflows token: ${{secrets.BOT_TOKEN}} # need all tags fetch-depth: 0 # try to get results from tests - uses: dawidd6/action-download-artifact@v2 continue-on-error: true with: workflow: ${{github.event.workflow_run.name}} run_id: ${{github.event.workflow_run.id}} name: results path: results - name: find-version run: | # rip version from lfs.h LFS_VERSION="$(grep -o '^#define LFS_VERSION .*$' lfs.h \ | awk '{print $3}')" LFS_VERSION_MAJOR="$((0xffff & ($LFS_VERSION >> 16)))" LFS_VERSION_MINOR="$((0xffff & ($LFS_VERSION >> 0)))" # find a new patch version based on what we find in our tags LFS_VERSION_PATCH="$( \ ( git describe --tags --abbrev=0 \ --match="v$LFS_VERSION_MAJOR.$LFS_VERSION_MINOR.*" \ || echo 'v0.0.-1' ) \ | awk -F '.' '{print $3+1}')" # found new version LFS_VERSION="v$LFS_VERSION_MAJOR` `.$LFS_VERSION_MINOR` `.$LFS_VERSION_PATCH" echo "LFS_VERSION=$LFS_VERSION" echo "LFS_VERSION=$LFS_VERSION" >> $GITHUB_ENV echo "LFS_VERSION_MAJOR=$LFS_VERSION_MAJOR" >> $GITHUB_ENV echo "LFS_VERSION_MINOR=$LFS_VERSION_MINOR" >> $GITHUB_ENV echo "LFS_VERSION_PATCH=$LFS_VERSION_PATCH" >> $GITHUB_ENV # try to find previous version? - name: find-prev-version continue-on-error: true run: | LFS_PREV_VERSION="$(git describe --tags --abbrev=0 --match 'v*')" echo "LFS_PREV_VERSION=$LFS_PREV_VERSION" echo "LFS_PREV_VERSION=$LFS_PREV_VERSION" >> $GITHUB_ENV # try to find results from tests - name: collect-results run: | # previous results to compare against? [ -n "$LFS_PREV_VERSION" ] && curl -sS \ "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/` `status/$LFS_PREV_VERSION?per_page=100" \ | jq -re 'select(.sha != env.GITHUB_SHA) | .statuses[]' \ >> prev-results.json \ || true # build table for GitHub echo "
Configuration | " >> results.txt for r in Code Stack Structs Coverage do echo "$r | " >> results.txt done echo "|
---|---|---|
${c_or_default^} | " >> results.txt for r in code stack structs do # per-config results echo "" >> results.txt
[ -e results/thumb${c:+-$c}.csv ] && ( \
export PREV="$(jq -re '
select(.context == "'"results (thumb${c:+, $c}) / $r"'").description
| capture("(? | " >> results.txt
done
# coverage results
if [ -z $c ]
then
echo "" >> results.txt
[ -e results/coverage.csv ] && ( \
export PREV="$(jq -re '
select(.context == "results / coverage").description
| capture("(? | " >> results.txt
fi
echo "