Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/.jira_sync_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# See https://github.com/canonical/gh-jira-sync-bot for config
settings:
jira_project_key: "ISD"

status_mapping:
opened: Untriaged
closed: done
not_planned: rejected

add_gh_comment: true

epic_key: ISD-3981

label_mapping:
bug: Bug
enhancement: Story
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Applicable spec: <link>

### Overview

<!-- A high level overview of the change -->

### Rationale

<!-- The reason the change is needed -->

### Module Changes

<!-- Any high level changes to modules -->

### Checklist

- [ ] The [contributing guide](https://github.com/canonical/is-charms-contributing-guide) was applied
- [ ] The documentation on README.md is updated.
- [ ] The PR is tagged with appropriate label (`urgent`, `trivial`, `complex`)

<!-- Explanation for any unchecked items above -->
13 changes: 11 additions & 2 deletions .github/workflows/checkin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 20
- name: Verify that action.yml files are in sync
run: |
npm run update-detached-action.yml &&
if ! git diff --exit-code \*action.yml
then
echo '::error::action.yml files are not in sync, maybe run `npm run update-detached-action.yml`?'
exit 1
fi
- name: Install dependencies
run: npm ci
- name: Run tests
Expand All @@ -24,7 +32,8 @@ jobs:
- name: Verify that the project is built
run: |
if [[ -n $(git status -s) ]]; then
echo "ERROR: generated dist/ differs from the current sources"
echo "ERROR: generated lib/ differs from the current sources"
git status -s
git diff
exit 1
fi
7 changes: 3 additions & 4 deletions .github/workflows/manual-detached-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
- uses: actions/checkout@v4
- uses: ./detached
with:
limit-access-to-actor: true
detached: true
connect-timeout-seconds: 60
- run: |
echo "A busy loop"
for value in $(seq 10)
Expand Down
92 changes: 61 additions & 31 deletions .github/workflows/manual-test.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,73 @@
name: Manual test matrix
on: workflow_dispatch
name: Manual test
on:
workflow_dispatch:
inputs:
runs-on:
type: choice
description: 'The runner pool to run the job on'
required: true
default: ubuntu-24.04
options:
- ubuntu-24.04
- ubuntu-22.04
- macos-15-large
- macos-15
- macos-14-large
- macos-14
- macos-13
- macos-13-xlarge
- windows-2025
- windows-2022
- windows-2019
- windows-11-arm
container-runs-on:
type: choice
description: 'The Docker container to run the job on (this overrides the `runs-on` input)'
required: false
default: '(none)'
options:
- '(none)'
- fedora:latest
- archlinux:latest
- ubuntu:latest
limit-access-to-actor:
type: choice
description: 'Whether to limit access to the actor only'
required: true
default: 'auto'
options:
- auto
- 'true'
- 'false'

jobs:
test:
strategy:
fail-fast: false
matrix:
runs-on:
- ubuntu-20.04
- ubuntu-22.04
- macos-11.0
- macos-12.0
- windows-2019
- windows-2022
limit-access-to-actor:
- true
- false
runs-on: ${{ matrix.runs-on }}
if: ${{ inputs.container-runs-on == '(none)' }}
runs-on: ${{ inputs.runs-on }}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
# The public preview of GitHub-hosted Windows/ARM64 runners lacks
# a working MSYS2 installation, so we need to set it up ourselves.
if: ${{ inputs.runs-on == 'windows-11-arm' }}
with:
msystem: 'CLANGARM64'
# We cannot use `C:\` because `msys2/setup-msys2` erroneously
# believes that an MSYS2 exists at `C:\msys64`, but it doesn't,
# which is the entire reason why we need to set it up in this
# here step... However, by using `C:\.\` we can fool that
# overzealous check.
location: C:\.\
- uses: actions/checkout@v4
- uses: ./
with:
limit-access-to-actor: ${{ matrix.limit-access-to-actor }}
limit-access-to-actor: ${{ inputs.limit-access-to-actor }}
test-container:
strategy:
fail-fast: false
matrix:
container-runs-on:
- fedora:latest
- archlinux:latest
- ubuntu:latest
limit-access-to-actor:
- true
- false
if: ${{ inputs.container-runs-on != '(none)' }}
runs-on: ubuntu-latest
container:
image: ${{ matrix.container-runs-on }}
image: ${{ inputs.container-runs-on }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./
with:
limit-access-to-actor: ${{ matrix.limit-access-to-actor }}
limit-access-to-actor: ${{ inputs.limit-access-to-actor }}
13 changes: 13 additions & 0 deletions .github/workflows/tmate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Canonical action-tmate test

on:
push:

jobs:
build:
runs-on: [self-hosted, linux, X64, jammy, large]
steps:
- name: Setup tmate session
uses: canonical/action-tmate@main
with:
detached: true
62 changes: 62 additions & 0 deletions .github/workflows/update-manual-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env node

// Update the `runs-on` options of the `manual-test.yml` workflow file with the
// latest available images from the GitHub Actions runner images README file.

(async () => {
const fs = require('fs')

const readme = await (await fetch("https://github.com/actions/runner-images/raw/HEAD/README.md")).text()

// This will be the first `ubuntu` one.
let defaultOption = ''

const choices = readme
// Get the "Available Images" section
.split(/\n## Available Images\n/)[1]
.split(/##\s*[^#]/)[0]
// Split by lines
.split('\n')
.map(line => {
// The relevant lines are table rows; The first column is the image name,
// the second one contains a relatively free-form list of the `runs-on`
// options that we are interested in. Those `runs-on` options are
// surrounded by backticks.
const match = line.match(/^\|\s*([^|]+)\s*\|([^|]*)`([^`|]+)`\s*\|/)
if (!match) return false // Skip e.g. the table header and empty lines
let runsOn = match[3] // default to the last `runs-on` option
const alternatives = match[2]
.split(/`([^`]*)`/) // split by backticks
.filter((_, i) => (i % 2)) // keep only the text between backticks
.sort((a, b) => a.length - b.length) // order by length
if (alternatives.length > 0 && alternatives[0].length < runsOn.length) runsOn = alternatives[0]
if (!defaultOption && match[3].startsWith('ubuntu-')) defaultOption = runsOn
return runsOn
})
.filter(runsOn => runsOn)

// The Windows/ARM64 runners are in public preview (and for the time being,
// not listed in the `runner-images` README file), so we need to add this
// manually.
if (!choices.includes('windows-11-arm')) choices.push('windows-11-arm')

// Now edit the `manual-test` workflow definition
const ymlPath = `${__dirname}/manual-test.yml`
const yml = fs.readFileSync(ymlPath, 'utf8')

// We want to replace the `runs-on` options and the `default` value. This
// would be easy if there was a built-in YAML parser and renderer in Node.js,
// but there is none. Therefore, we use a regular expression to find certain
// "needles" near the beginning of the file: first `workflow_dispatch:`,
// after that `runs-on:` and then `default:` and `options:`. Then we replace
// the `default` value and the `options` values with the new ones.
const [, beforeDefault, beforeOptions, optionsIndent, afterOptions] =
yml.match(/^([^]*?workflow_dispatch:[^]*?runs-on:[^]*?default:)(?:.*)([^]*?options:)(\n +- )(?:.*)(?:\3.*)*([^]*)/) || []
if (!beforeDefault) throw new Error(`The 'manual-test.yml' file does not match the expected format!`)
const newYML =
`${beforeDefault} ${defaultOption}${[beforeOptions, ...choices].join(optionsIndent)}${afterOptions}`
fs.writeFileSync(ymlPath, newYML)
})().catch(e => {
console.error(e)
process.exitCode = 1
})
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @canonical/platform-engineering
Loading
Loading