Skip to content

Commit

Permalink
Merge pull request #280 from noir-cr/yamllinting
Browse files Browse the repository at this point in the history
Update GitHub workflow files
  • Loading branch information
hahwul authored Apr 25, 2024
2 parents 72e79e0 + f0615bd commit 052daa2
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 111 deletions.
75 changes: 28 additions & 47 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,39 @@

---
🔬 analyzer:
- changed-files:
- any-glob-to-any-file:
- src/analyzer/**
- src/models/analyzer.cr

- changed-files:
- any-glob-to-any-file: [src/analyzer/**, src/models/analyzer.cr]
💌 deliver:
- changed-files:
- any-glob-to-any-file:
- src/deliver/**
- src/models/deliver.cr

- changed-files:
- any-glob-to-any-file: [src/deliver/**, src/models/deliver.cr]
🔎 detector:
- changed-files:
- any-glob-to-any-file:
- src/detector/**
- src/models/detector.cr

- changed-files:
- any-glob-to-any-file: [src/detector/**, src/models/detector.cr]
🥢 mini-lexer:
- changed-files:
- any-glob-to-any-file:
- src/minilexers/**
- src/models/minilexer/**

- changed-files:
- any-glob-to-any-file: [src/minilexers/**, src/models/minilexer/**]
📦 output-builder:
- changed-files:
- any-glob-to-any-file:
- src/output_builder/**
- src/models/output_builder.cr

- changed-files:
- any-glob-to-any-file:
- src/output_builder/**
- src/models/output_builder.cr
🏷️ tagger:
- changed-files:
- any-glob-to-any-file:
- src/taggers/**
- src/models/tag.cr

- changed-files:
- any-glob-to-any-file: [src/taggers/**, src/models/tag.cr]
💊 spec:
- changed-files:
- any-glob-to-any-file: spec/**

- changed-files:
- any-glob-to-any-file: spec/**
🦺 github-action:
- changed-files:
- any-glob-to-any-file: .github/workflows/**

- changed-files:
- any-glob-to-any-file: .github/workflows/**
📑 documentation:
- changed-files:
- any-glob-to-any-file: docs/**

- changed-files:
- any-glob-to-any-file: docs/**
⚙️ options:
- changed-files:
- any-glob-to-any-file: src/options.cr

- changed-files:
- any-glob-to-any-file: src/options.cr
🛥️ workflow:
- changed-files:
- any-glob-to-any-file:
- .github/workflows/**
- .github/labeler.yml
- changed-files:
- any-glob-to-any-file: [.github/workflows/**, .github/labeler.yml]
🐳 docker:
- changed-files:
- any-glob-to-any-file: Dockerfile
25 changes: 9 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,45 @@
---
name: Crystal CI
name: CI
on:
pull_request_target:
branches: [main, dev]
jobs:
build-noir:
build-crystal:
runs-on: ubuntu-latest
strategy:
matrix:
crystal-version: ['1.10.1', '1.11.2', '1.12.1']
matrix:
crystal-version: [1.10.1, 1.11.2, 1.12.1]
steps:
- uses: actions/checkout@v4
- uses: MeilCli/setup-crystal-action@v4
with:
crystal_version: ${{ matrix.crystal-version }}

- name: Install dependencies
run: shards install

- name: Build
run: shards build

build-docker:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [linux/amd64, linux/arm64]
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/[email protected]
with:
cosign-release: 'v2.1.1'

cosign-release: v2.1.1
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v3

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}

- name: Build Docker image
id: build-and-push
uses: docker/build-push-action@v5
Expand All @@ -53,10 +48,9 @@ jobs:
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64, linux/arm64
platforms: ${{ matrix.arch }}
cache-from: type=gha
cache-to: type=gha,mode=max

lint:
runs-on: ubuntu-latest
container:
Expand All @@ -68,7 +62,6 @@ jobs:
uses: crystal-ameba/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

tests:
runs-on: ubuntu-latest
container:
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/contributors.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
---
name: Contributors
on:
push:
branches:
- main
- dev
branches: [main, dev]
workflow_dispatch:
inputs:
logLevel:
description: 'manual run'
required: false
default: ''
inputs:
logLevel:
description: manual run
required: false
default: ''
jobs:
contributors:
runs-on: ubuntu-latest
steps:
- uses: wow-actions/contributors-list@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
round: true
round: true
19 changes: 8 additions & 11 deletions .github/workflows/ghcr_publish.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,30 @@
---
name: GHCR Publish

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
branches: [ "main" , "dev" ]
tags: [ 'v*.*.*' ]

branches: [main, dev]
tags: [v*.*.*]
env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
arch: [linux/amd64, linux/arm64]
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -38,7 +35,7 @@ jobs:
if: github.event_name != 'pull_request'
uses: sigstore/[email protected]
with:
cosign-release: 'v2.1.1'
cosign-release: v2.1.1

# Using QEME for multiple platforms
# https://github.com/docker/build-push-action?tab=readme-ov-file#usage
Expand Down Expand Up @@ -77,6 +74,6 @@ jobs:
push: ${{ github.event_name != 'pull_request' && github.ref != 'refs/heads/dev' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64, linux/arm64
platforms: ${{ matrix.arch }}
cache-from: type=gha
cache-to: type=gha,mode=max
20 changes: 7 additions & 13 deletions .github/workflows/homebrew_publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
---
name: Homebrew tab Publish

on:
release:
types: [published]

jobs:
homebrew-releaser:
runs-on: ubuntu-latest
Expand All @@ -15,21 +14,16 @@ jobs:
homebrew_owner: noir-cr
homebrew_tap: homebrew-noir
formula_folder: Formula

github_token: ${{ secrets.NOIR_PUBLISH_TOKEN }}

commit_owner: hahwul
commit_email: [email protected]

depends_on: |
"crystal"
"crystal"
install: |
system "shards install"
system "shards build --release --no-debug --production"
bin.install "bin/noir"
test: 'system "{bin}/noir", "-v"'
system "shards install"
system "shards build --release --no-debug --production"
bin.install "bin/noir"
test: system "{bin}/noir", "-v"
update_readme_table: true
skip_commit: false
debug: false
debug: false
9 changes: 4 additions & 5 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: "Pull Request Labeler"
on:
- pull_request_target

---
name: Pull Request Labeler
on: [pull_request_target]
jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
- uses: actions/labeler@v5
15 changes: 5 additions & 10 deletions .github/workflows/snapcraft_publish.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
---
name: Snapcraft tab Publish

on:
release:
types: [published]

workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
description: Log level
required: true
default: 'warning'
default: warning
tags:
description: 'Test scenario tags'

description: Test scenario tags
jobs:
snapcraft-releaser:
runs-on: ubuntu-latest
Expand All @@ -21,21 +19,18 @@ jobs:
fail-fast: false
matrix:
platform:
- amd64
- amd64
#- arm64
steps:
- name: Check out Git repository
uses: actions/checkout@v3

- uses: diddlesnaps/snapcraft-multiarch-action@v1
with:
architecture: ${{ matrix.platform }}
id: build

- uses: diddlesnaps/snapcraft-review-action@v1
with:
snap: ${{ steps.build.outputs.snap }}

- uses: snapcore/action-publish@master
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_STORE_LOGIN }}
Expand Down

0 comments on commit 052daa2

Please sign in to comment.