From 32c379c8c92202805aeed651d3cfd2f6999ac375 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 00:19:23 +0000 Subject: [PATCH 01/10] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/zricethezav/gitleaks: v8.15.0 → v8.15.1](https://github.com/zricethezav/gitleaks/compare/v8.15.0...v8.15.1) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a42700d..1689fdf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: - id: detect-secrets stages: ["commit", "push"] - repo: https://github.com/zricethezav/gitleaks - rev: v8.15.0 + rev: v8.15.1 hooks: - id: gitleaks stages: ["commit", "push"] From 4d08d5a227034c0cdeebe9839b905ffbd6c454ba Mon Sep 17 00:00:00 2001 From: fabasoad Date: Fri, 25 Nov 2022 22:39:12 +0900 Subject: [PATCH 02/10] Bump pre-commit/pre-commit-hooks from 4.3.0 to 4.4.0 --- .github/CODEOWNERS | 1 + .github/workflows/create-release.yml | 14 ++++++-------- .github/workflows/functional-tests.yml | 13 +++++-------- .gitignore | 1 + .markdownlint.yml | 4 ++++ .pre-commit-config.yaml | 3 +-- README.md | 12 +++++++----- action.yml | 2 +- 8 files changed, 26 insertions(+), 24 deletions(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..6770962 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @fabasoad diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 32ceef7..f7801a9 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -18,10 +18,10 @@ jobs: id: latest_release run: | latest_tag=$(curl --silent "https://api.github.com/repos/${{ github.repository }}/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/') - echo "::set-output name=tag::${latest_tag}" + echo "tag=${latest_tag}" >> $GITHUB_OUTPUT - name: Get current release tag id: current_release - run: echo "::set-output name=tag::${GITHUB_REF/refs\/tags\//}" + run: echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT - name: Build changelog id: changelog run: | @@ -29,15 +29,13 @@ jobs: body="${body//'%'/'%25'}" body="${body//$'\n'/'%0A'}" body="${body//$'\r'/'%0D'}" - echo "::set-output name=body::${body}" + echo "body=${body}" >> $GITHUB_OUTPUT - name: Create release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v1 with: tag_name: ${{ github.ref }} - release_name: ${{ steps.current_release.outputs.tag }} + name: ${{ steps.current_release.outputs.tag }} + token: ${{ secrets.GITHUB_TOKEN }} body: | # Changelog diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index c0a0493..e45e15e 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -5,23 +5,20 @@ on: push: branches: - 'main' - - 'fix-*' - - 'feature-*' + pull_request: jobs: functional_tests: name: Run script timeout-minutes: 5 strategy: + fail-fast: false matrix: os: ['ubuntu-latest', 'windows-latest', 'macos-latest'] version: ['0.1.dev0', '0.1.dev1'] - fail-fast: false runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - with: - ref: ${{ github.ref }} - uses: ./ with: version: ${{ matrix.version }} @@ -32,9 +29,9 @@ jobs: echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.++" > ./hello-world.bf echo "+.------.--------.>>+.>++." >> ./hello-world.bf output=$(brainfucky --file ./hello-world.bf) - rm ./hello-world.bf - [[ "${output:32:12}" == "Hello World!" ]] || exit 1; - shell: bash + rm -f ./hello-world.bf + [ "${output:32:12}" = "Hello World!" ] || exit 1; + shell: sh - name: Validate command (Windows) if: ${{ matrix.os == 'windows-latest' }} run: | diff --git a/.gitignore b/.gitignore index 0a71bd0..2ac7a9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store +.envrc .idea .vscode diff --git a/.markdownlint.yml b/.markdownlint.yml index d852558..02d4457 100644 --- a/.markdownlint.yml +++ b/.markdownlint.yml @@ -1,2 +1,6 @@ --- default: true +MD013: + code_blocks: false + tables: false +MD041: false diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1689fdf..010afcf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,10 +23,9 @@ repos: rev: v1.28.0 hooks: - id: yamllint - args: ["-c", ".yamllint.yml"] # Other - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.3.0 + rev: v4.4.0 hooks: - id: check-merge-conflict - id: check-json diff --git a/README.md b/README.md index b0fbcc0..38aa7a9 100644 --- a/README.md +++ b/README.md @@ -6,19 +6,21 @@ This action installs one of the brainfuck interpreters called [brainfucky](https://pypi.org/project/brainfucky/). +## Prerequisites + +The following tools have to be installed for successful work of this GitHub action: +[pip3](https://pip.pypa.io/en/stable/). + ## Inputs - | Name | Required | Description | Default | Possible values | |---------|----------|---------------------------------------------------------------------------------------------------|------------|------------------------| | version | No | Brainfucky library version that can be found [here](https://pypi.org/project/brainfucky/) version | `0.1.dev1` | `0.1.dev1`, `0.1.dev0` | - ## Example usage ### Workflow configuration - ```yaml name: Test @@ -37,9 +39,9 @@ jobs: echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.++" > ./hello-world.bf echo "+.------.--------.>>+.>++." >> ./hello-world.bf brainfucky --file ./hello-world.bf - rm ./hello-world.bf + rm -f ./hello-world.bf + shell: sh ``` - ### Result diff --git a/action.yml b/action.yml index 0ae2178..a69a51b 100644 --- a/action.yml +++ b/action.yml @@ -15,4 +15,4 @@ runs: steps: - name: Install Brainfuck run: pip3 install brainfucky==${{ inputs.version }} - shell: bash + shell: sh From 8039c9d92abdac8b6dc53df5cf6ba80dd5cbc11d Mon Sep 17 00:00:00 2001 From: fabasoad Date: Fri, 25 Nov 2022 22:46:18 +0900 Subject: [PATCH 03/10] Debug 1 --- .github/workflows/functional-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index e45e15e..5ffb52c 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -22,18 +22,18 @@ jobs: - uses: ./ with: version: ${{ matrix.version }} - - name: Validate command (non-Windows) - if: ${{ matrix.os != 'windows-latest' }} + - name: Validate command (Linux, macOS) + if: ${{ runner.os != 'Windows' }} run: | touch ./hello-world.bf echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.++" > ./hello-world.bf echo "+.------.--------.>>+.>++." >> ./hello-world.bf output=$(brainfucky --file ./hello-world.bf) rm -f ./hello-world.bf - [ "${output:32:12}" = "Hello World!" ] || exit 1; + [ "$(echo "$output" | cut -b32- | cut -b-12)" = "Hello World!" ] || exit 1; shell: sh - name: Validate command (Windows) - if: ${{ matrix.os == 'windows-latest' }} + if: ${{ runner.os == 'Windows' }} run: | New-Item -Path . -Name "hello-world.bf" -ItemType "file" -Value "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.++`n+.------.--------.>>+.>++." $Output = (brainfucky --file ./hello-world.bf) | Out-String From 88156de997a16a2f9acd0dcd162f8c2ccb2a536a Mon Sep 17 00:00:00 2001 From: fabasoad Date: Fri, 25 Nov 2022 22:47:45 +0900 Subject: [PATCH 04/10] Debug 2 --- .github/workflows/functional-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index 5ffb52c..455dcc0 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -29,6 +29,7 @@ jobs: echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.++" > ./hello-world.bf echo "+.------.--------.>>+.>++." >> ./hello-world.bf output=$(brainfucky --file ./hello-world.bf) + echo "^$output^" rm -f ./hello-world.bf [ "$(echo "$output" | cut -b32- | cut -b-12)" = "Hello World!" ] || exit 1; shell: sh From c6343192b3508894e86844554a31b20032f0b017 Mon Sep 17 00:00:00 2001 From: fabasoad Date: Fri, 25 Nov 2022 22:49:37 +0900 Subject: [PATCH 05/10] Debug 3 --- .github/workflows/functional-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index 455dcc0..52ff012 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -29,9 +29,9 @@ jobs: echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.++" > ./hello-world.bf echo "+.------.--------.>>+.>++." >> ./hello-world.bf output=$(brainfucky --file ./hello-world.bf) - echo "^$output^" + echo '^$(echo "$output" | cut -b32-)^' rm -f ./hello-world.bf - [ "$(echo "$output" | cut -b32- | cut -b-12)" = "Hello World!" ] || exit 1; + [ "$(echo "$output" | cut -b32-)" = "Hello World!" ] || exit 1; shell: sh - name: Validate command (Windows) if: ${{ runner.os == 'Windows' }} From dc18bf551c61a0a82cde09ba85b44bfc7ac68af5 Mon Sep 17 00:00:00 2001 From: fabasoad Date: Fri, 25 Nov 2022 22:51:18 +0900 Subject: [PATCH 06/10] Debug 4 --- .github/workflows/functional-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index 52ff012..bc9a7b1 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -29,7 +29,7 @@ jobs: echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.++" > ./hello-world.bf echo "+.------.--------.>>+.>++." >> ./hello-world.bf output=$(brainfucky --file ./hello-world.bf) - echo '^$(echo "$output" | cut -b32-)^' + echo "$output" | cut -b32- rm -f ./hello-world.bf [ "$(echo "$output" | cut -b32-)" = "Hello World!" ] || exit 1; shell: sh From 467f03d334993a592ec98e0ac84332d31a584ade Mon Sep 17 00:00:00 2001 From: fabasoad Date: Fri, 25 Nov 2022 22:52:59 +0900 Subject: [PATCH 07/10] Debug 5 --- .github/workflows/functional-tests.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index bc9a7b1..4a198db 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -28,10 +28,9 @@ jobs: touch ./hello-world.bf echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.++" > ./hello-world.bf echo "+.------.--------.>>+.>++." >> ./hello-world.bf - output=$(brainfucky --file ./hello-world.bf) - echo "$output" | cut -b32- + output=$(brainfucky --file ./hello-world.bf | cut -b32-) rm -f ./hello-world.bf - [ "$(echo "$output" | cut -b32-)" = "Hello World!" ] || exit 1; + [ "${output}" = "Hello World!" ] || exit 1; shell: sh - name: Validate command (Windows) if: ${{ runner.os == 'Windows' }} From d86d69f2054fdf37ccbac55a002ce7b1deda0b83 Mon Sep 17 00:00:00 2001 From: fabasoad Date: Fri, 25 Nov 2022 22:53:53 +0900 Subject: [PATCH 08/10] Debug 6 --- .github/workflows/functional-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index 4a198db..d707122 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -29,6 +29,7 @@ jobs: echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.++" > ./hello-world.bf echo "+.------.--------.>>+.>++." >> ./hello-world.bf output=$(brainfucky --file ./hello-world.bf | cut -b32-) + echo "^$output^" rm -f ./hello-world.bf [ "${output}" = "Hello World!" ] || exit 1; shell: sh From 4623de399a68c67bff8ff8202dfc70035a314dd3 Mon Sep 17 00:00:00 2001 From: fabasoad Date: Fri, 25 Nov 2022 22:57:04 +0900 Subject: [PATCH 09/10] Debug 7 --- .github/workflows/functional-tests.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/functional-tests.yml b/.github/workflows/functional-tests.yml index d707122..957fcf8 100644 --- a/.github/workflows/functional-tests.yml +++ b/.github/workflows/functional-tests.yml @@ -28,11 +28,10 @@ jobs: touch ./hello-world.bf echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.++" > ./hello-world.bf echo "+.------.--------.>>+.>++." >> ./hello-world.bf - output=$(brainfucky --file ./hello-world.bf | cut -b32-) - echo "^$output^" - rm -f ./hello-world.bf - [ "${output}" = "Hello World!" ] || exit 1; - shell: sh + output=$(brainfucky --file ./hello-world.bf) + rm ./hello-world.bf + [[ "${output:32:12}" == "Hello World!" ]] || exit 1; + shell: bash - name: Validate command (Windows) if: ${{ runner.os == 'Windows' }} run: | From a49bf2697c305dc183217edc523dd76941be570b Mon Sep 17 00:00:00 2001 From: fabasoad Date: Fri, 25 Nov 2022 23:00:26 +0900 Subject: [PATCH 10/10] Debug 8 --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 38aa7a9..aa948c1 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,12 @@ jobs: echo "++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.++" > ./hello-world.bf echo "+.------.--------.>>+.>++." >> ./hello-world.bf brainfucky --file ./hello-world.bf - rm -f ./hello-world.bf - shell: sh + rm ./hello-world.bf ``` ### Result -```shell +```text executing file ./hello-world.bf Hello World! ```