Awk grains #551
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
--- | |
# | |
# .github/workflows/tcl.yml | |
# | |
name: Tcl Workflow | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
stage1: | |
name: Change Check | |
runs-on: 'ubuntu-latest' | |
outputs: | |
docs_changed: ${{ steps.check_file_changed.outputs.docs_changed }} | |
steps: | |
- name: Checkout Repo | |
id: checkout-repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref }} | |
submodules: recursive | |
- name: Get Change List | |
id: check_file_changed | |
run: | | |
# Diff HEAD with the previous commit then output to stdout. | |
printf "=== Which files changed? ===\n" | |
GIT_DIFF="$(git diff --name-only HEAD^ HEAD)" | |
printf "%s\n" "${GIT_DIFF}" | |
printf "\n" | |
# Check if the files are present in the changed file list (added, modified, deleted) then output to stdout. | |
HAS_DIFF=false | |
printf "=== Which Tcl files changed? ===\n" | |
if printf "%s\n" "${GIT_DIFF}" | grep -E '^(tcl/.*[.]tcl|.github/workflows/tcl.yml)$'; then | |
HAS_DIFF=true | |
fi | |
printf "\n" | |
# Did Golang files change? | |
printf "=== Did Golang files change? ===\n" | |
printf "%s\n" "${HAS_DIFF}" | |
printf "\n" | |
# Set the output named "docs_changed" | |
printf "%s=%s\n" "docs_changed" "${HAS_DIFF}" >> "${GITHUB_OUTPUT}" | |
stage2: | |
name: Tcl Checks | |
strategy: | |
matrix: | |
os: ["ubuntu-latest"] | |
runs-on: "${{ matrix.os }}" | |
needs: [stage1] | |
if: needs.stage1.outputs.docs_changed == 'True' | |
steps: | |
- name: Checkout Repo | |
id: checkout-repo | |
uses: actions/checkout@v3 | |
- name: Set up Tcl | |
id: setup-tcl | |
run: | | |
sudo apt install -y tcl | |
- name: Show Tcl version | |
id: tcl-version | |
run: | | |
tclsh <<< 'puts [info patchlevel];exit 0' | |
# shellcheck disable=SC2016 | |
tclsh <<< 'puts $tcl_version;exit 0' | |
- name: Install Tcl Tools | |
id: install-tcl-tools | |
run: | | |
./.github/citools/tcl/nagelfar -h | grep -- Version | |
- name: CD to Tcl Dir | |
id: cd-to-tcl-dir | |
run: | | |
pwd | |
ls | |
cd ./tcl | |
pwd | |
ls | |
- name: Analysing the code with lint | |
id: tcl-lint | |
run: | | |
cd ./tcl | |
./for_each ../../.github/citools/tcl/tcl-check | |
- name: Testing with Tcl test | |
id: tcl-test-run | |
run: |- | |
cd ./tcl | |
./for_each ../../.github/citools/tcl/tcl-test |