Skip to content

Commit

Permalink
committing much later in the middle of work
Browse files Browse the repository at this point in the history
  • Loading branch information
mahiki committed May 12, 2024
1 parent eecf7c4 commit c6818dd
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 16 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/GHA.actions-handy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,27 @@ jobs:
just-macos-things:
runs-on: macos-latest
steps:
- name: some basic items
run: |
printf "github.event_name: %s\n" '${{ github.event_name }}'
printf "runner.os: %s\n" '${{ runner.os }}'
printf "github.ref (branch): %s\n" '${{ github.ref }}'
printf "github.repository: %s\n" '${{ github.repository }}'
printf "github workspace: %s\n" '${{ github.workspace }}'
printf "github branch/tag name: %s\n" '${{ github.ref_name }}'
printf "github branch/tag name from env var: %s\n" "$GITHUB_REF_NAME"
- name: Get latest tag
id: get_tag
run: echo ::set-output name=tag::$(git describe --tags --abbrev=0)

- name: Get latest tag
id: get_tag
run: |
"tag=$(git describe --tags --abbrev=0)"
echo "tag=${tag}" >> $GITHUB_OUTPUT
- name: some basic items
run: |
printf "github.event_name: %s\n" '${{ github.event_name }}'
printf "runner.os: %s\n" '${{ runner.os }}'
printf "github.ref (branch): %s\n" '${{ github.ref }}'
printf "github.repository: %s\n" '${{ github.repository }}'
printf "github workspace: %s\n" '${{ github.workspace }}'
printf "github branch/tag name: %s\n" '${{ github.ref_name }}'
printf "github branch/tag name from env var: %s\n" "$GITHUB_REF_NAME"
printf "latest tag name: %s\n" "${{ steps.get_tag.outputs.tag }}"

ubuntu-town:
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
pipx install --python $(which python) poetry
poetry install
poetry show --latest
- name: Get latest tag
- run: |
git branch --list
git log --oneline --tags -n10 --pretty=format:'%h %as %cn %x09%s %d'
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,25 @@ jobs:
- run: |
echo "REMINDER: Warnings are disabled"
- name: Get latest tag
id: get_tag
run: |
latest_tag=$(git describe --tags --abbrev=0)"
echo "latest_tag="${latest_tag}" >> $GITHUB_OUTPUT
- name: Get Poetry application version
id: app_version
run: |
poetry_app_version="$(poetry version --short)"
echo "poetry_app_version="v${poetry_app_version}" >> $GITHUB_OUTPUT
- name: Print some workflow contexts
run: |
echo "workflow: ${{ github.workflow }}"
echo "job_id: ${{ github.job }}"
echo "job status: ${{ job.status }}"
echo "commit tag name: ${{ github.ref_name }}"
echo "commit ref name: ${{ github.ref_name }}"
echo "branch name: ${{ github.ref }}
echo "latest tag: ${{ steps.get_tag.outputs.latest_tag }}"
echo "poetry app version: ${{ steps.app_version.outputs.poetry_app_version }}"
20 changes: 14 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
YW := '\033[0;33m'
RD := '\033[0;31m'
LC := '\033[0;36m'
LB := '\033[0;34m'
LG := '\033[0;32m'
NC := '\033[0m'
home_dir := `echo "$HOME"`
export DOCKER_HOST := home_dir/".rd/docker.sock"

# just --list
default:
Expand Down Expand Up @@ -54,3 +50,15 @@ test *args:
@echo
@echo " ✙✙✙✙✙✙✙✙ TESTING ✙✙✙✙✙✙✙✙"
poetry run pytest --disable-warnings --verbose {{args}}

# act github actions runner
act *args:
act --container-architecture linux/amd64 {{args}}

# colors for output
YW := '\033[0;33m'
RD := '\033[0;31m'
LC := '\033[0;36m'
LB := '\033[0;34m'
LG := '\033[0;32m'
NC := '\033[0m'
27 changes: 27 additions & 0 deletions notes/CICD-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,30 @@ jobs:
## OPTIONAL ADDITIONS
Prerelease actions are available with examples of various approaches.
[marvinpinto/actions release](https://github.com/marvinpinto/action-automatic-releases)


### ACT local github actions runner
Justfile is keeping the docker host and container arch flag.
UGH. Problems with sockets, not macos images.... hopeless.

```sh
brew install act
# using Rancher Desktop in dockerd mode
export DOCKER_HOST=$HOME/.rd/docker.sock

act --container-architecture linux/amd64 -l
# Stage Job ID Job name Workflow name Workflow file Events
# 0 ubuntu-town ubuntu-town GHA Handy Workflow Reference GHA.actions-handy.yml push,workflow_dispatch
# 0 official-actions-usage official-actions-usage GHA Handy Workflow Reference GHA.actions-handy.yml push,workflow_dispatch
# 0 just-macos-things just-macos-things GHA Handy Workflow Reference GHA.actions-handy.yml push,workflow_dispatch
# 0 on-failure on-failure Merge Release Branch and Tag main.yml workflow_run
# 0 merge-and-tag merge-and-tag Merge Release Branch and Tag main.yml workflow_run
# 0 release release Release desertislandutils release.yml workflow_run
# 0 poetry-run-tests poetry-run-tests Test desertislandutils test.yml push,pull_request,workflow_dispatch

act --container-architecture linux/amd64 -j poetry-run-tests -P macos-latest=-self-hosted
# dang

-P ubuntu-18.04=nektos/act-environments-ubuntu:18.04

```

0 comments on commit c6818dd

Please sign in to comment.