Implementierung v0
This commit is contained in:
10
.gitea/workflows/check-is-not-released.yaml
Normal file
10
.gitea/workflows/check-is-not-released.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
name: check if project is already released
|
||||
on:
|
||||
- pull_request
|
||||
|
||||
jobs:
|
||||
unittest:
|
||||
runs-on: action-runner
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./check-is-not-released
|
||||
176
.gitea/workflows/check.yaml
Normal file
176
.gitea/workflows/check.yaml
Normal file
@@ -0,0 +1,176 @@
|
||||
name: run tests
|
||||
on:
|
||||
- pull_request
|
||||
- workflow_call
|
||||
|
||||
jobs:
|
||||
unittest:
|
||||
runs-on: action-runner
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: unittest
|
||||
shell: nix develop --command bash -- {0}
|
||||
run: just test-python
|
||||
|
||||
test-declare-default:
|
||||
runs-on: action-runner
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: ./declare
|
||||
with:
|
||||
configure_runner_environment: false
|
||||
|
||||
- run: set -u; echo "$RELEASE_PROJECT_CURRENT_VERSION"
|
||||
|
||||
test-sync-versions:
|
||||
runs-on: action-runner
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# skip login locally
|
||||
- if: github.repository == 'actions/release'
|
||||
uses: https://gitea.puzzleyou.net/actions/configure-runner-environment@master
|
||||
|
||||
- run: |
|
||||
echo "1.33.7" > /tmp/version-test.txt
|
||||
echo "0.0.42" > /tmp/other-version.txt
|
||||
|
||||
- uses: ./declare
|
||||
with:
|
||||
configure_runner_environment: false
|
||||
version_descriptor: /tmp/version-test.txt
|
||||
artefact_type: oci_image
|
||||
artefact_name: default-image
|
||||
artefact_version_descriptor: /tmp/other-version.txt
|
||||
|
||||
- uses: ./sync-versions
|
||||
|
||||
- run: test "$(cat /tmp/version-test.txt)" = "$RELEASE_PROJECT_PLANNED_VERSION"
|
||||
- run: test "$(cat /tmp/other-version.txt)" = "$RELEASE_PROJECT_PLANNED_VERSION"
|
||||
|
||||
test-is-not-yet-released:
|
||||
runs-on: action-runner
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# skip login locally
|
||||
- if: github.repository == 'actions/release'
|
||||
uses: https://gitea.puzzleyou.net/actions/configure-runner-environment@master
|
||||
|
||||
- uses: ./declare
|
||||
with:
|
||||
configure_runner_environment: false
|
||||
version_descriptor: test-assets/version.txt
|
||||
|
||||
- uses: ./check-is-not-released
|
||||
with:
|
||||
configure_runner_environment: false
|
||||
|
||||
test-skip-release-if-already-released:
|
||||
runs-on: action-runner
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# skip login locally
|
||||
- if: github.repository == 'actions/release'
|
||||
uses: https://gitea.puzzleyou.net/actions/configure-runner-environment@master
|
||||
|
||||
- uses: ./declare
|
||||
with:
|
||||
configure_runner_environment: false
|
||||
version_descriptor: test-assets/Cargo.toml
|
||||
|
||||
- uses: ./release
|
||||
with:
|
||||
configure_runner_environment: false
|
||||
dry_run: true
|
||||
sync_versions: false
|
||||
|
||||
test-declare-with-release-yaml:
|
||||
runs-on: action-runner
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# skip login locally
|
||||
- if: github.repository == 'actions/release'
|
||||
uses: https://gitea.puzzleyou.net/actions/configure-runner-environment@master
|
||||
|
||||
- uses: ./release
|
||||
with:
|
||||
dry_run: true
|
||||
configure_runner_environment: false
|
||||
sync_versions: false
|
||||
|
||||
- run: set -u; echo "$RELEASE_PROJECT_CURRENT_VERSION"
|
||||
|
||||
test-declare-directly:
|
||||
runs-on: action-runner
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: ./declare
|
||||
with:
|
||||
configure_runner_environment: false
|
||||
version_descriptor: test-assets/version.txt
|
||||
repository: actions/release
|
||||
artefact_type: oci_image
|
||||
artefact_name: default-image
|
||||
deployment_type: helm_release
|
||||
deployment_release_name: example-testing
|
||||
|
||||
- uses: ./add-artefact
|
||||
with:
|
||||
type: "oci_image"
|
||||
name: "some-docker-image"
|
||||
repository: "special"
|
||||
version_descriptor: "test-assets/Cargo.toml"
|
||||
|
||||
- uses: ./add-artefact
|
||||
with:
|
||||
type: tarball
|
||||
filename: "test-assets/foo.tar.gz"
|
||||
package_name: foo
|
||||
|
||||
- uses: ./add-artefact
|
||||
with:
|
||||
type: wheel
|
||||
filename: "test-assets/wheels/*.whl"
|
||||
|
||||
- uses: ./add-artefact
|
||||
with:
|
||||
type: sdist
|
||||
filename: "test-assets/pypkgs.42.tar.gz"
|
||||
|
||||
- uses: ./add-artefact
|
||||
with:
|
||||
type: npm
|
||||
directory: "test-assets/browser/dist"
|
||||
|
||||
- uses: ./add-deployment
|
||||
with:
|
||||
type: helm_release
|
||||
release_name: other-testing
|
||||
image_paths: image.foo.tag image.bar.tag
|
||||
namespace: different-testing
|
||||
repository: europe-docker.hetzner.cloud/puzzleyou/helm
|
||||
condition: always
|
||||
|
||||
- name: ensure that default artefact is set
|
||||
run: env | grep "RELEASE_IMAGE_LOCAL_NAME_DEFAULT_IMAGE"
|
||||
|
||||
- name: ensure that additional artefact is set
|
||||
run: env | grep "RELEASE_IMAGE_LOCAL_NAME_SOME_DOCKER_IMAGE"
|
||||
|
||||
- name: dump release environment variables
|
||||
run: env | grep "RELEASE_"
|
||||
|
||||
- name: check version
|
||||
run: echo "$RELEASE_PROJECT_CURRENT_VERSION" | grep "1.33.7"
|
||||
|
||||
- name: check state file is set
|
||||
run: set -u; echo "$RELEASE_ACTION_STATEFILE"
|
||||
|
||||
- name: dump project description
|
||||
uses: ./dump
|
||||
|
||||
17
.gitea/workflows/release.yaml
Normal file
17
.gitea/workflows/release.yaml
Normal file
@@ -0,0 +1,17 @@
|
||||
name: run tests
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- testing
|
||||
|
||||
jobs:
|
||||
check:
|
||||
uses: ./.gitea/workflows/check.yaml
|
||||
|
||||
release:
|
||||
needs: ["check"]
|
||||
runs-on: action-runner
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./
|
||||
Reference in New Issue
Block a user