Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update centrally managed files #6

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1595e79
update .gitignore
soleng-terraform[bot] Sep 17, 2024
70b4b1a
update .gitignore
soleng-terraform[bot] Sep 18, 2024
4d05427
update .github/workflows/release.yaml
soleng-terraform[bot] Sep 18, 2024
979908f
update .github/workflows/check.yaml
soleng-terraform[bot] Sep 18, 2024
a831109
update .github/workflows/release.yaml
soleng-terraform[bot] Sep 18, 2024
a4749b5
update .gitignore
soleng-terraform[bot] Sep 18, 2024
118b54b
update .github/workflows/check.yaml
soleng-terraform[bot] Sep 18, 2024
2ee8edf
update .github/workflows/release.yaml
soleng-terraform[bot] Sep 18, 2024
80b19f8
update .gitignore
soleng-terraform[bot] Sep 18, 2024
9684642
update .github/workflows/check.yaml
soleng-terraform[bot] Sep 18, 2024
033197b
update .github/workflows/release.yaml
soleng-terraform[bot] Sep 19, 2024
1b8452b
update .gitignore
soleng-terraform[bot] Sep 19, 2024
937f76e
update .github/workflows/check.yaml
soleng-terraform[bot] Sep 19, 2024
f680c59
update .github/workflows/check.yaml
soleng-terraform[bot] Sep 20, 2024
f185426
update .github/workflows/release.yaml
soleng-terraform[bot] Sep 20, 2024
fde1d58
update .gitignore
soleng-terraform[bot] Sep 20, 2024
2abba86
update .gitignore
soleng-terraform[bot] Sep 23, 2024
3c86651
update .github/workflows/release.yaml
soleng-terraform[bot] Sep 23, 2024
770dcaf
update .github/workflows/check.yaml
soleng-terraform[bot] Sep 23, 2024
d0ca6d4
update .github/workflows/release.yaml
soleng-terraform[bot] Sep 23, 2024
56b2daa
update .gitignore
soleng-terraform[bot] Sep 23, 2024
bd7bb3b
update .github/workflows/check.yaml
soleng-terraform[bot] Sep 23, 2024
8d8372d
update .gitignore
soleng-terraform[bot] Sep 23, 2024
5d8558a
update .github/workflows/release.yaml
soleng-terraform[bot] Sep 23, 2024
d8c9621
update .github/workflows/check.yaml
soleng-terraform[bot] Sep 23, 2024
ec8d2ec
update .gitignore
soleng-terraform[bot] Sep 24, 2024
de24a97
update .github/workflows/release.yaml
soleng-terraform[bot] Sep 24, 2024
f937c5c
update .github/workflows/check.yaml
soleng-terraform[bot] Sep 24, 2024
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
66 changes: 64 additions & 2 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,83 @@ jobs:
with:
fetch-depth: 0 # Complete git history is required to generate the version from git tags.

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y yamllint
python -m pip install --upgrade pip
# pin tox to the current major version to avoid
# workflows breaking all at once when a new major version is released.
python -m pip install 'tox<5'

- name: Run linters
run: tox -e lint

- name: Lint yaml files
run: |
yamllint .yamllint snap/snapcraft.yaml

build:
runs-on: ubuntu-22.04
needs:
- lint
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [[ubuntu-22.04]]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Complete git history is required to generate the version from git tags.

- name: Verify snap builds successfully
uses: snapcore/action-build@v1
id: build
uses: canonical/action-build@v1

- name: Determine system architecture
run: echo "SYSTEM_ARCH=$(uname -m)" >> $GITHUB_ENV

- name: Upload the built snap
uses: actions/upload-artifact@v4
with:
name: snap_${{ env.SYSTEM_ARCH }}
path: ${{ steps.build.outputs.snap }}

func:
needs:
- build
runs-on: ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [[ubuntu-22.04]]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Complete git history is required to generate the version from git tags.

- name: Determine system architecture
run: echo "SYSTEM_ARCH=$(uname -m)" >> $GITHUB_ENV

- name: Download the built snap
uses: actions/download-artifact@v4
with:
name: snap_${{ env.SYSTEM_ARCH }}

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install 'tox<5'

- name: Run functional tests
run: tox -e func

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this repo doesn't have a tox file, or any functional tests, so maybe we can't use this template :/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add func test, and just do an endpoint testing because we don't necessarily have smart devices in the CI environment.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a prefect case that using tox as an interface will encounter

It's ok to create an exception for this case right now from my point of view.

12 changes: 9 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,25 @@ jobs:
secrets: inherit

release:
runs-on: ubuntu-22.04
runs-on: ${{ matrix.runs-on }}
needs: check
strategy:
fail-fast: false
matrix:
runs-on: [[ubuntu-22.04]]
outputs:
snap: ${{ steps.build.outputs.snap }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Complete git history is required to generate the version from git tags.
- uses: snapcore/action-build@v1
- uses: canonical/action-build@v1
id: build
- name: Determine system architecture
run: echo "SYSTEM_ARCH=$(uname -m)" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
with:
name: snap
name: snap_${{ env.SYSTEM_ARCH }}
path: ${{ steps.build.outputs.snap }}
- uses: snapcore/action-publish@v1
env:
Expand Down
50 changes: 42 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,45 @@
# Environments
.env
# This file is centrally managed as a template file in https://github.com/canonical/solutions-engineering-automation
# To update the file:
# - Edit it in the canonical/solutions-engineering-automation repository.
# - Open a PR with the changes.
# - When the PR merges, the soleng-terraform bot will open a PR to the target repositories with the changes.

# Python Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Test files and directories
.pytest_cache/
.coverage
.tox
reports/
**/report/
htmlcov/
.mypy_cache

# python virtual environments (for local dev)
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
venv
env

# Snap
# Build artefacts
output/
.build/
build/
*.charm
*.snap
# python build artefacts
deb_dist/
dist/
*.egg-info/

# Log files
*.log

# general backup files
*~
*.bak

# Note: for editor-specific files, please don't add them here, as they are specific to your environment, not the project.
# Instead, consider using a global gitignore on your workstation.
Loading