Skip to content

Commit

Permalink
Merge pull request #1 from glektarssza/feature/setup
Browse files Browse the repository at this point in the history
[Chore] Setup repository
  • Loading branch information
glektarssza authored Sep 3, 2024
2 parents 9b1f578 + 86c135f commit fac67d1
Show file tree
Hide file tree
Showing 15 changed files with 789 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# yaml-language-server: $schema=https://json.schemastore.org/dependabot-2.0.json
version: 2
updates:
- directory: /
package-ecosystem: github-actions
labels:
- Dependency
schedule:
interval: weekly
day: wednesday
time: "12:00"
timezone: Canada/Mountain
65 changes: 65 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Build
on:
workflow_call:
secrets:
github-token:
required: true
description: |
The token to use when making authenticated GitHub API calls.
inputs:
build-os:
required: true
type: string
description: |
The operating system to build for.
Valid options are:
* `windows`
* `linux`
* `macos`
outputs:
artifact-id:
description: |
The ID of the artifact generated by this workflow.
value: ${{jobs.build.outputs.artifact-id}}
artifact-name:
description: |
The name of the artifact generated by this workflow.
value: ${{jobs.build.outputs.artifact-name}}
jobs:
build:
name: Build
runs-on: ${{(inputs.build-os == 'windows' && 'windows-latest') || (inputs.build-os == 'linux' && 'ubuntu-latest') || (inputs.build-os == 'macos' && 'macos-latest') || ''}}
outputs:
artifact-id: ${{steps.upload-artifacts.outputs.artifact-id}}
artifact-name: dist-${{inputs.build-os}}
steps:
- id: install-tasks
name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.github-token || secrets.GITHUB_TOKEN }}
- id: checkout-repository
name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{secrets.github-token || secrets.GITHUB_TOKEN}}
lfs: true
- id: setup-odin
name: Setup Odin
uses: laytan/setup-odin@v2.5.2
with:
token: ${{secrets.github-token || secrets.GITHUB_TOKEN}}
release: latest
- id: build-distribution
name: Build distribution
run: task dist
- id: upload-artifacts
name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist-${{inputs.build-os}}
path: dist
35 changes: 35 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Lint
on:
workflow_call:
secrets:
github-token:
required: true
description: |
The token to use when making authenticated GitHub API calls.
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- id: install-tasks
name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.github-token || secrets.GITHUB_TOKEN }}
- id: checkout-repository
name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{secrets.github-token || secrets.GITHUB_TOKEN}}
lfs: true
- id: setup-odin
name: Setup Odin
uses: laytan/setup-odin@v2.5.2
with:
token: ${{secrets.github-token || secrets.GITHUB_TOKEN}}
release: latest
- id: lint
name: Lint
run: task lint
40 changes: 40 additions & 0 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Pull Request
on:
pull_request:
branches:
- main
jobs:
build:
name: Build
strategy:
fail-fast: true
matrix:
build-os:
- windows
- linux
- macos
uses: ./.github/workflows/build.yaml
secrets:
github-token: ${{secrets.GITHUB_TOKEN}}
with:
build-os: ${{matrix.build-os}}
test:
name: Test
strategy:
fail-fast: true
matrix:
build-os:
- windows
- linux
- macos
uses: ./.github/workflows/test.yaml
secrets:
github-token: ${{secrets.GITHUB_TOKEN}}
with:
build-os: ${{matrix.build-os}}
lint:
name: Lint
uses: ./.github/workflows/lint.yaml
secrets:
github-token: ${{secrets.GITHUB_TOKEN}}
38 changes: 38 additions & 0 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Push
on:
push:
jobs:
build:
name: Build
strategy:
fail-fast: true
matrix:
build-os:
- windows
- linux
- macos
uses: ./.github/workflows/build.yaml
secrets:
github-token: ${{secrets.GITHUB_TOKEN}}
with:
build-os: ${{matrix.build-os}}
test:
name: Test
strategy:
fail-fast: true
matrix:
build-os:
- windows
- linux
- macos
uses: ./.github/workflows/test.yaml
secrets:
github-token: ${{secrets.GITHUB_TOKEN}}
with:
build-os: ${{matrix.build-os}}
lint:
name: Lint
uses: ./.github/workflows/lint.yaml
secrets:
github-token: ${{secrets.GITHUB_TOKEN}}
47 changes: 47 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Test
on:
workflow_call:
secrets:
github-token:
required: true
description: |
The token to use when making authenticated GitHub API calls.
inputs:
build-os:
required: true
type: string
description: |
The operating system to build for.
Valid options are:
* `windows`
* `linux`
* `macos`
jobs:
test:
name: Test
runs-on: ${{(inputs.build-os == 'windows' && 'windows-latest') || (inputs.build-os == 'linux' && 'ubuntu-latest') || (inputs.build-os == 'macos' && 'macos-latest') || ''}}
steps:
- id: install-tasks
name: Install Task
uses: arduino/setup-task@v2
with:
version: 3.x
repo-token: ${{ secrets.github-token || secrets.GITHUB_TOKEN }}
- id: checkout-repository
name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{secrets.github-token || secrets.GITHUB_TOKEN}}
lfs: true
- id: setup-odin
name: Setup Odin
uses: laytan/setup-odin@v2.5.2
with:
token: ${{secrets.github-token || secrets.GITHUB_TOKEN}}
release: latest
- id: test
name: Test
run: task test
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,12 @@ tags

# Environment #
.envrc

# Odin Language Server #
ols.json

# Artifacts #
.task/
build/
dist/
*.zip
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"recommendations": [
"github.remotehub",
"github.vscode-pull-request-github",
"github.vscode-github-actions",
"danielgavin.ols",
"vadimcn.vscode-lldb",
"task.vscode-task"
]
}
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"program": "${workspaceFolder}/build/odincraft-debug",
"windows": {
"program": "${workspaceFolder}/build/odincraft-debug.exe"
},
"args": [],
"cwd": "${workspaceFolder}",
"preLaunchTask": "${defaultBuildTask}"
}
]
}
41 changes: 41 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "pre-debug",
"detail": "Build the project prior to debugging it.",
"icon": {
"id": "tools",
"color": "terminal.ansiCyan"
},
"group": {
"kind": "build",
"isDefault": true
},
"hide": false,
"dependsOn": [],
"dependsOrder": "sequence",
"isBackground": false,
"promptOnClose": false,
"type": "shell",
"command": "task",
"args": [
"build-debug"
],
"runOptions": {
"instanceLimit": 1,
"reevaluateOnRerun": true,
"runOn": "default"
},
"presentation": {
"echo": false,
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": false
},
"problemMatcher": []
}
]
}
13 changes: 13 additions & 0 deletions odinfmt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://raw.githubusercontent.com/DanielGavin/ols/master/misc/odinfmt.schema.json",
"brace_style": "_1TBS",
"character_width": 80,
"convert_do": false,
"exp_multiline_composite_literals": false,
"indent_cases": false,
"newline_limit": 1,
"newline_style": "LF",
"spaces": 4,
"tabs": false,
"tabs_width": 4
}
8 changes: 8 additions & 0 deletions src/main.odin
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package pinentry_win_cred

//-- Core Libraries
import "core:fmt"

main :: proc() {
fmt.println("Hello, Odin!")
}
Loading

0 comments on commit fac67d1

Please sign in to comment.