Skip to content

Commit

Permalink
♻️Supported programming language release versions as of 2/21 and upda…
Browse files Browse the repository at this point in the history
…te README.md
  • Loading branch information
7rikazhexde committed Feb 20, 2025
1 parent e6a46a3 commit 2f86b41
Show file tree
Hide file tree
Showing 27 changed files with 273 additions and 96 deletions.
21 changes: 0 additions & 21 deletions .gitattributes

This file was deleted.

7 changes: 6 additions & 1 deletion .github/workflows/go_project_matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
"go": [
"1.23.0",
"1.23.1",
"1.23.2"
"1.23.2",
"1.23.3",
"1.23.4",
"1.23.5",
"1.23.6",
"1.24.0"
]
},
"ghpages_branch": "ghgapes"
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/go_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ jobs:
echo "versions_go[0]: ${{ fromJson(steps.json2vars.outputs.versions_go)[0] }}"
echo "versions_go[1]: ${{ fromJson(steps.json2vars.outputs.versions_go)[1] }}"
echo "versions_go[2]: ${{ fromJson(steps.json2vars.outputs.versions_go)[2] }}"
echo "versions_go[3]: ${{ fromJson(steps.json2vars.outputs.versions_go)[3] }}"
echo "versions_go[4]: ${{ fromJson(steps.json2vars.outputs.versions_go)[4] }}"
echo "versions_go[5]: ${{ fromJson(steps.json2vars.outputs.versions_go)[5] }}"
echo "versions_go[6]: ${{ fromJson(steps.json2vars.outputs.versions_go)[6] }}"
echo "versions_go[7]: ${{ fromJson(steps.json2vars.outputs.versions_go)[7] }}"
echo "ghpages_branch: ${{ steps.json2vars.outputs.ghpages_branch }}"
run_tests:
Expand Down Expand Up @@ -94,6 +99,11 @@ jobs:
versions_go_0="${{ fromJson(needs.set_variables.outputs.versions_go)[0] }}"
versions_go_1="${{ fromJson(needs.set_variables.outputs.versions_go)[1] }}"
versions_go_2="${{ fromJson(needs.set_variables.outputs.versions_go)[2] }}"
versions_go_3="${{ fromJson(needs.set_variables.outputs.versions_go)[3] }}"
versions_go_4="${{ fromJson(needs.set_variables.outputs.versions_go)[4] }}"
versions_go_5="${{ fromJson(needs.set_variables.outputs.versions_go)[5] }}"
versions_go_6="${{ fromJson(needs.set_variables.outputs.versions_go)[6] }}"
versions_go_7="${{ fromJson(needs.set_variables.outputs.versions_go)[7] }}"
echo "os: ${os}"
echo "os_0: ${os_0}"
Expand All @@ -103,6 +113,11 @@ jobs:
echo "versions_go_0: ${versions_go_0}"
echo "versions_go_1: ${versions_go_1}"
echo "versions_go_2: ${versions_go_2}"
echo "versions_go_3: ${versions_go_3}"
echo "versions_go_4: ${versions_go_4}"
echo "versions_go_5: ${versions_go_5}"
echo "versions_go_6: ${versions_go_6}"
echo "versions_go_7: ${versions_go_7}"
echo "ghpages_branch: ${ghpages_branch}"
# For loop case
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/nodejs_project_matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"16",
"18",
"20",
"22"
"22",
"23"
]
},
"ghpages_branch": "ghgapes"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/nodejs_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
echo "versions_nodejs[1]: ${{ fromJson(steps.json2vars.outputs.versions_nodejs)[1] }}"
echo "versions_nodejs[2]: ${{ fromJson(steps.json2vars.outputs.versions_nodejs)[2] }}"
echo "versions_nodejs[3]: ${{ fromJson(steps.json2vars.outputs.versions_nodejs)[3] }}"
echo "versions_nodejs[4]: ${{ fromJson(steps.json2vars.outputs.versions_nodejs)[4] }}"
echo "ghpages_branch: ${{ steps.json2vars.outputs.ghpages_branch }}"
run_tests:
Expand Down Expand Up @@ -98,6 +99,7 @@ jobs:
versions_nodejs_1="${{ fromJson(needs.set_variables.outputs.versions_nodejs)[1] }}"
versions_nodejs_2="${{ fromJson(needs.set_variables.outputs.versions_nodejs)[2] }}"
versions_nodejs_3="${{ fromJson(needs.set_variables.outputs.versions_nodejs)[3] }}"
versions_nodejs_4="${{ fromJson(needs.set_variables.outputs.versions_nodejs)[4] }}"
echo "os: ${os}"
echo "os_0: ${os_0}"
Expand All @@ -108,6 +110,7 @@ jobs:
echo "versions_nodejs_1: ${versions_nodejs_1}"
echo "versions_nodejs_2: ${versions_nodejs_2}"
echo "versions_nodejs_3: ${versions_nodejs_3}"
echo "versions_nodejs_4: ${versions_nodejs_4}"
echo "ghpages_branch: ${ghpages_branch}"
# For loop case
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/ruby_project_matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
"ruby": [
"3.0.6",
"3.1.6",
"3.2.6"
"3.2.6",
"3.3.6",
"3.4.0",
"3.4.1",
"3.3.7",
"3.2.7",
"3.4.2"
]
},
"ghpages_branch": "ghgapes"
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/ruby_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ jobs:
echo "versions_ruby[0]: ${{ fromJson(steps.json2vars.outputs.versions_ruby)[0] }}"
echo "versions_ruby[1]: ${{ fromJson(steps.json2vars.outputs.versions_ruby)[1] }}"
echo "versions_ruby[2]: ${{ fromJson(steps.json2vars.outputs.versions_ruby)[2] }}"
echo "versions_ruby[3]: ${{ fromJson(steps.json2vars.outputs.versions_ruby)[3] }}"
echo "versions_ruby[4]: ${{ fromJson(steps.json2vars.outputs.versions_ruby)[4] }}"
echo "versions_ruby[5]: ${{ fromJson(steps.json2vars.outputs.versions_ruby)[5] }}"
echo "versions_ruby[6]: ${{ fromJson(steps.json2vars.outputs.versions_ruby)[6] }}"
echo "versions_ruby[7]: ${{ fromJson(steps.json2vars.outputs.versions_ruby)[7] }}"
echo "versions_ruby[8]: ${{ fromJson(steps.json2vars.outputs.versions_ruby)[8] }}"
echo "ghpages_branch: ${{ steps.json2vars.outputs.ghpages_branch }}"
run_tests:
Expand Down Expand Up @@ -92,6 +98,12 @@ jobs:
versions_ruby_0="${{ fromJson(needs.set_variables.outputs.versions_ruby)[0] }}"
versions_ruby_1="${{ fromJson(needs.set_variables.outputs.versions_ruby)[1] }}"
versions_ruby_2="${{ fromJson(needs.set_variables.outputs.versions_ruby)[2] }}"
versions_ruby_3="${{ fromJson(needs.set_variables.outputs.versions_ruby)[3] }}"
versions_ruby_4="${{ fromJson(needs.set_variables.outputs.versions_ruby)[4] }}"
versions_ruby_5="${{ fromJson(needs.set_variables.outputs.versions_ruby)[5] }}"
versions_ruby_6="${{ fromJson(needs.set_variables.outputs.versions_ruby)[6] }}"
versions_ruby_7="${{ fromJson(needs.set_variables.outputs.versions_ruby)[7] }}"
versions_ruby_8="${{ fromJson(needs.set_variables.outputs.versions_ruby)[8] }}"
echo "os: ${os}"
echo "os_0: ${os_0}"
Expand All @@ -101,6 +113,12 @@ jobs:
echo "versions_ruby_0: ${versions_ruby_0}"
echo "versions_ruby_1: ${versions_ruby_1}"
echo "versions_ruby_2: ${versions_ruby_2}"
echo "versions_ruby_3: ${versions_ruby_3}"
echo "versions_ruby_4: ${versions_ruby_4}"
echo "versions_ruby_5: ${versions_ruby_5}"
echo "versions_ruby_6: ${versions_ruby_6}"
echo "versions_ruby_7: ${versions_ruby_7}"
echo "versions_ruby_8: ${versions_ruby_8}"
echo "ghpages_branch: ${ghpages_branch}"
# For loop case
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/rust_project_matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"1.80.0",
"1.81.0",
"1.82.0",
"1.83.0",
"1.84.0",
"1.84.1",
"stable"
]
},
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/rust_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
echo "versions_rust[2]: ${{ fromJson(steps.json2vars.outputs.versions_rust)[2] }}"
echo "versions_rust[3]: ${{ fromJson(steps.json2vars.outputs.versions_rust)[3] }}"
echo "versions_rust[4]: ${{ fromJson(steps.json2vars.outputs.versions_rust)[4] }}"
echo "versions_rust[5]: ${{ fromJson(steps.json2vars.outputs.versions_rust)[5] }}"
echo "versions_rust[6]: ${{ fromJson(steps.json2vars.outputs.versions_rust)[6] }}"
echo "versions_rust[7]: ${{ fromJson(steps.json2vars.outputs.versions_rust)[7] }}"
echo "ghpages_branch: ${{ steps.json2vars.outputs.ghpages_branch }}"
run_tests:
Expand Down Expand Up @@ -95,6 +98,9 @@ jobs:
versions_rust_2="${{ fromJson(needs.set_variables.outputs.versions_rust)[2] }}"
versions_rust_3="${{ fromJson(needs.set_variables.outputs.versions_rust)[3] }}"
versions_rust_4="${{ fromJson(needs.set_variables.outputs.versions_rust)[4] }}"
versions_rust_5="${{ fromJson(needs.set_variables.outputs.versions_rust)[5] }}"
versions_rust_6="${{ fromJson(needs.set_variables.outputs.versions_rust)[6] }}"
versions_rust_7="${{ fromJson(needs.set_variables.outputs.versions_rust)[7] }}"
echo "os: ${os}"
echo "os_0: ${os_0}"
Expand All @@ -106,6 +112,9 @@ jobs:
echo "versions_rust_2: ${versions_rust_2}"
echo "versions_rust_3: ${versions_rust_3}"
echo "versions_rust_4: ${versions_rust_4}"
echo "versions_rust_5: ${versions_rust_5}"
echo "versions_rust_6: ${versions_rust_6}"
echo "versions_rust_7: ${versions_rust_7}"
echo "ghpages_branch: ${ghpages_branch}"
# For loop case
Expand Down
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
"-A",
"clippy::needless_return"
],
"rust-analyzer.linkedProjects": [
"./examples/rust/Cargo.toml"
],
// Rubyの固有設定
"[ruby]": {
"editor.defaultFormatter": "Shopify.ruby-lsp", // Use the Ruby LSP as the default formatter
Expand All @@ -86,7 +89,7 @@
"rubyLsp.formatter": "rubocop",
"files.insertFinalNewline": true,
// golangの固有設定
"go.gopath": "", // 必要に応じて設定してください
"go.gopath": "",
"go.useLanguageServer": true,
"go.lintOnSave": "file",
"go.lintTool": "golangci-lint", // golangci-lintを推奨しますが、go vetなども選択可能
Expand All @@ -105,6 +108,7 @@
"go.testFlags": [
"-v"
], // テストの詳細表示オプション
// GitHub Actionsの固有設定
"github-actions.workflows.pinned.workflows": [
".github/workflows/dependabot_prch.yml",
".github/workflows/prch_test_matrix_json.yml",
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- [Inputs](#inputs)
- [Outputs](#outputs)
- [Examples](#examples)
- [Releases Info Link](#releases-info-link)
- [Variable Reference Examples](#variable-reference-examples)
- [1. Basic Usage (Within Same Job)](#1-basic-usage-within-same-job)
- [2. Cross-Job Usage (Using needs Context)](#2-cross-job-usage-using-needs-context)
Expand Down Expand Up @@ -95,6 +96,16 @@ This action uses a JSON configuration file (e.g. [matrix.json](.github/workflows
<details>
<summary>Complete Configuration Example</summary>

### Releases Info Link

| Lang | Release link |
|-----------|-------------------------------------------------------------------------|
| ![Python](https://img.shields.io/badge/Python-3776AB?style=flat&logo=python&logoColor=white) | [Python Documentation by Version](https://www.python.org/doc/versions/) |
| ![Node.js](https://img.shields.io/badge/Node.js-339933?style=flat&logo=node.js&logoColor=white) | [Node.js Releases](https://nodejs.org/en/about/previous-releases) |
| [![Ruby](https://img.shields.io/badge/Ruby-CC342D?style=flat&logo=ruby&logoColor=white)](.github/workflows/ruby_test.yml) | [Ruby Releases](https://www.ruby-lang.org/en/downloads/releases/) |
| ![Go](https://img.shields.io/badge/Go-00ADD8?style=flat&logo=go&logoColor=white) | [All Releases](https://go.dev/dl/) |
| ![Rust](https://img.shields.io/badge/Rust-000000?style=flat&logo=rust&logoColor=white) | [Releases](https://github.com/rust-lang/rust/releases) |

```json
{
"os": [
Expand Down Expand Up @@ -145,6 +156,8 @@ You can also create a simplified configuration by including only the languages y
<details>
<summary>Simplified Configuration Example</summary>

Please check [Python Documentation by Version](https://www.python.org/doc/versions/) and create `.github/workflows/python_project_matrix.json`

```jsonc
{
"os": [
Expand Down
9 changes: 7 additions & 2 deletions examples/go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ The `jsonparser` package provides functionality to parse JSON configuration file

## JSON Configuration Format

Plaese create `.github/workflows/go_project_matrix.json`
Please check [All Releases](https://go.dev/dl/) and create `.github/workflows/go_project_matrix.json`

```json
{
Expand All @@ -102,7 +102,12 @@ Plaese create `.github/workflows/go_project_matrix.json`
"go": [
"1.23.0",
"1.23.1",
"1.23.2"
"1.23.2",
"1.23.3",
"1.23.4",
"1.23.5",
"1.23.6",
"1.24.0"
]
},
"ghpages_branch": "ghgapes"
Expand Down
2 changes: 1 addition & 1 deletion examples/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module json2vars-setter-example

go 1.20
go 1.24.0
10 changes: 5 additions & 5 deletions examples/go/jsonparser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ import (
"os"
)

// MatrixConfig は設定JSONの構造を定義
// MatrixConfig は設定JSONの構造を定義します
type MatrixConfig struct {
OS []string `json:"os"`
Versions map[string][]string `json:"versions"`
GhPagesBranch string `json:"ghpages_branch"`
}

// ParseConfig はJSONファイルを読み込んで解析する
// ParseConfig はJSONファイルを読み込んで解析します
func ParseConfig(filePath string, silent bool) (*MatrixConfig, error) {
data, err := os.ReadFile(filePath)
if err != nil {
if !silent {
fmt.Printf("Error reading JSON file: %v\n", err)
fmt.Printf("Error reading config file: %v\n", err)
}
return nil, err
return nil, fmt.Errorf("failed to read config file: %w", err)
}

var config MatrixConfig
if err := json.Unmarshal(data, &config); err != nil {
if !silent {
fmt.Printf("Error parsing JSON: %v\n", err)
}
return nil, err
return nil, fmt.Errorf("failed to parse JSON: %w", err)
}

return &config, nil
Expand Down
2 changes: 1 addition & 1 deletion examples/go/jsonparser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestParseConfig(t *testing.T) {
check: func(c *MatrixConfig) bool {
// JSONファイルの実際の値と一致するように更新
expectedOS := []string{"ubuntu-latest", "windows-latest", "macos-latest"}
expectedVersions := []string{"1.23.0", "1.23.1", "1.23.2"}
expectedVersions := []string{"1.23.0", "1.23.1", "1.23.2", "1.23.3", "1.23.4", "1.23.5", "1.23.6", "1.24.0"}

if !reflect.DeepEqual(c.OS, expectedOS) {
t.Errorf("Expected OS %v, got %v", expectedOS, c.OS)
Expand Down
7 changes: 4 additions & 3 deletions examples/nodejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ npm test
- Validates JSON parsing functionality
- Tests error handling and edge cases

## JSON Configuration
## JSON Configuration Format

The parser expects a JSON file with the following structure:
Please check [Node.js Releases](https://nodejs.org/en/about/previous-releases) and create `.github/workflows/nodejs_project_matrix.json`

```json
{
Expand All @@ -94,7 +94,8 @@ The parser expects a JSON file with the following structure:
"16",
"18",
"20",
"22"
"22",
"23"
]
},
"ghpages_branch": "ghgapes"
Expand Down
3 changes: 2 additions & 1 deletion examples/nodejs/tests/utils/jsonParser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ describe('parseConfigJson', () => {
expect(result.os).toContain('macos-latest');

expect(result.versions).toHaveProperty('nodejs');
expect(result.versions.nodejs).toHaveLength(4);
expect(result.versions.nodejs).toHaveLength(5);
expect(result.versions.nodejs).toContain('16');
expect(result.versions.nodejs).toContain('18');
expect(result.versions.nodejs).toContain('20');
expect(result.versions.nodejs).toContain('22');
expect(result.versions.nodejs).toContain('23');

expect(result.ghpages_branch).toBe('ghgapes');
});
Expand Down
2 changes: 1 addition & 1 deletion examples/ruby/.ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.6
3.4.2
Loading

0 comments on commit 2f86b41

Please sign in to comment.