Skip to content

Commit

Permalink
ci: use GitHub Actions (#12)
Browse files Browse the repository at this point in the history
This repo needs almost no care or feeding,
so keep it simple by using GitHub Actions for CI.
  • Loading branch information
axw committed Jun 14, 2023
1 parent 70549d9 commit 2955d61
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/addToAPMProject.yml
@@ -0,0 +1,51 @@
name: Add to APM Project
on:
issues:
types:
- opened
jobs:
add_to_project:
runs-on: ubuntu-latest
name: Assign issues to APM Project for the Server Team
steps:
- uses: octokit/graphql-action@v2.x
id: add_to_project
with:
query: |
mutation add_to_project($projectid:ID!,$contentid:ID!) {
addProjectV2ItemById(input:{projectId:$projectid contentId:$contentid}) {
item {
... on ProjectV2Item {
id
}
}
}
}
projectid: ${{ env.PROJECT_ID }}
contentid: ${{ github.event.issue.node_id }}
env:
PROJECT_ID: "PVT_kwDOAGc3Zs0VSg"
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
- uses: octokit/graphql-action@v2.x
id: label_team
with:
query: |
mutation label_team($projectid:ID!,$itemid:ID!,$fieldid:ID!,$value:String!) {
updateProjectV2ItemFieldValue(input: { projectId:$projectid itemId:$itemid fieldId:$fieldid value:{singleSelectOptionId: $value} }) {
projectV2Item {
id
content {
... on Issue {
number
}
}
}
}
}
projectid: ${{ env.PROJECT_ID }}
itemid: ${{ fromJSON(steps.add_to_project.outputs.data).addProjectV2ItemById.item.id }}
fieldid: "PVTSSF_lADOAGc3Zs0VSs2scg"
value: "6c538d8a"
env:
PROJECT_ID: "PVT_kwDOAGc3Zs0VSg"
GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,28 @@
name: ci

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

# limit the access of the generated GITHUB_TOKEN
permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [oldstable, stable]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
cache-dependency-path: '**/go.sum'
- name: Unit tests
run: go test -v ./...

0 comments on commit 2955d61

Please sign in to comment.