-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a999c0
commit cf054b8
Showing
3 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# GitHub Actions workflow to lint the locale files. | ||
name: "Lint" | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
merge_group: | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.event.number || github.ref }}" | ||
cancel-in-progress: "${{ github.event.action != 'merge_group' }}" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
lint: | ||
name: "Lint" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: "Checkout repository" | ||
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: "Setup Go stable" | ||
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5 | ||
with: | ||
go-version: "stable" | ||
cache: true | ||
check-latest: true | ||
|
||
- name: "Download dependencies" | ||
run: go mod download | ||
|
||
- name: "Verify dependencies" | ||
run: go mod verify | ||
|
||
- name: "Build" | ||
run: go build -v ./... | ||
|
||
- name: "Test" | ||
run: go test -race -v ./... | ||
|
||
- name: "Lint" | ||
run: | | ||
go build -trimpath ./cmd/lang-lint | ||
./lang-lint |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"hypera.dev/axolotl-lang/v2" | ||
) | ||
|
||
func main() { | ||
if err := lang.LoadLocales(); err != nil { | ||
_, _ = fmt.Fprintln(os.Stderr, err) | ||
os.Exit(1) | ||
} | ||
|
||
fmt.Println("Locales loaded successfully", lang.Bundle().LanguageTags()) | ||
} |
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