Skip to content

Commit 3f54a53

Browse files
committed
ci: setup
Signed-off-by: Roman Volosatovs <[email protected]>
1 parent 014e413 commit 3f54a53

File tree

10 files changed

+618
-0
lines changed

10 files changed

+618
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @rvolosatovs

.github/actions/build-nix/action.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: build via Nix
2+
3+
inputs:
4+
package:
5+
description: package specification to build
6+
required: true
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- run: nix build -L '.#${{ inputs.package }}'
12+
shell: bash
13+
- run: nix run -L --inputs-from . 'nixpkgs#coreutils' -- --coreutils-prog=cp -RLv ./result '${{ inputs.package }}'
14+
shell: bash
15+
- uses: actions/upload-artifact@v4
16+
with:
17+
name: ${{ inputs.package }}
18+
path: ${{ inputs.package }}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: install Nix
2+
3+
inputs:
4+
cachixAuthToken:
5+
description: auth token for https://app.cachix.org/organization/wasmcloud/cache/wrpc
6+
7+
runs:
8+
using: composite
9+
steps:
10+
- uses: DeterminateSystems/nix-installer-action@v10
11+
with:
12+
extra-conf: |
13+
accept-flake-config = true
14+
15+
- uses: DeterminateSystems/magic-nix-cache-action@v4
16+
17+
- uses: cachix/cachix-action@v14
18+
continue-on-error: true
19+
with:
20+
name: wrpc
21+
authToken: '${{ inputs.cachixAuthToken }}'

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "daily"

.github/workflows/nix.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: nix
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
push:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
fmt:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/[email protected]
17+
- uses: ./.github/actions/install-nix
18+
with:
19+
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
20+
- run: nix fmt
21+
22+
run:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/[email protected]
26+
- uses: ./.github/actions/install-nix
27+
with:
28+
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
29+
- run: nix run -L . -- --version
30+
31+
develop:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/[email protected]
35+
- uses: ./.github/actions/install-nix
36+
with:
37+
cachixAuthToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
38+
- run: nix develop -L --ignore-environment -c cargo tree

.github/workflows/scorecard.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
name: Scorecard supply-chain security
6+
on:
7+
# For Branch-Protection check. Only the default branch is supported. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
9+
branch_protection_rule:
10+
# To guarantee Maintained check is occasionally updated. See
11+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
12+
schedule:
13+
- cron: '45 1 * * 1'
14+
push:
15+
branches: [ "main" ]
16+
17+
# Declare default permissions as read only.
18+
permissions: read-all
19+
20+
jobs:
21+
analysis:
22+
name: Scorecard analysis
23+
runs-on: ubuntu-latest
24+
permissions:
25+
# Needed to upload the results to code-scanning dashboard.
26+
security-events: write
27+
# Needed to publish results and get a badge (see publish_results below).
28+
id-token: write
29+
# Uncomment the permissions below if installing in a private repository.
30+
# contents: read
31+
# actions: read
32+
33+
steps:
34+
- name: "Checkout code"
35+
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
36+
with:
37+
persist-credentials: false
38+
39+
- name: "Run analysis"
40+
uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2
41+
with:
42+
results_file: results.sarif
43+
results_format: sarif
44+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
45+
# - you want to enable the Branch-Protection check on a *public* repository, or
46+
# - you are installing Scorecard on a *private* repository
47+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action#authentication-with-pat.
48+
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
49+
50+
# Public repositories:
51+
# - Publish results to OpenSSF REST API for easy access by consumers
52+
# - Allows the repository to include the Scorecard badge.
53+
# - See https://github.com/ossf/scorecard-action#publishing-results.
54+
# For private repositories:
55+
# - `publish_results` will always be set to `false`, regardless
56+
# of the value entered here.
57+
publish_results: true
58+
59+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
60+
# format to the repository Actions tab.
61+
- name: "Upload artifact"
62+
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
63+
with:
64+
name: SARIF file
65+
path: results.sarif
66+
retention-days: 5
67+
68+
# Upload the results to GitHub's code scanning dashboard.
69+
- name: "Upload to code-scanning"
70+
uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4
71+
with:
72+
sarif_file: results.sarif

.github/workflows/update.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: nix-flake-update
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
nix-flake-update:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: rvolosatovs/nix-flake-update-action@v2
13+
with:
14+
app-id: ${{ secrets.BOT_APP_ID }}
15+
private-key: ${{ secrets.BOT_APP_PRIVATE_KEY }}
16+
assignees: rvolosatovs
17+
reviewers: rvolosatovs
18+
delete-branch: true
19+
signoff: true
20+
labels: dependencies

0 commit comments

Comments
 (0)