-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove old files and use new templates [SOLENG-833] (#90)
* Remove old files and use new templates Note that check.yaml differs from the snap_check template in automation, because currently the snap_check template does not have a job for unit tests.
- Loading branch information
1 parent
3178284
commit 70afa06
Showing
10 changed files
with
193 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
name: Tests | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: [main] | ||
paths-ignore: | ||
- "**.md" | ||
- "**.rst" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
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: 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 | ||
unit: | ||
name: Unit | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.8", "3.10"] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install 'tox<5' | ||
- name: Run unit tests | ||
run: tox -e unit | ||
|
||
build: | ||
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 | ||
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 snap file artifact | ||
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: Setup Juju environment | ||
uses: charmed-kubernetes/actions-operator@main | ||
with: | ||
provider: "lxd" | ||
juju-channel: "3.5/stable" | ||
charmcraft-channel: "3.x/stable" | ||
|
||
- name: Run func tests | ||
run: | | ||
export TEST_SNAP="$(pwd)/$(ls | grep '.*_.*\.snap$')" | ||
echo "$TEST_SNAP" | ||
tox -e func |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
extends: default | ||
|
||
rules: | ||
line-length: disable | ||
document-start: disable |
Oops, something went wrong.