Skip to content

Commit

Permalink
Move nightly cleanup job to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
timtay-microsoft committed May 1, 2024
1 parent bb343e2 commit b323063
Show file tree
Hide file tree
Showing 7 changed files with 503 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Nightly Cleanup

on:
workflow_dispatch:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 1
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package -DskipTests
- name: Cleanup
run: java -jar iot-e2e-tests/device-deletion-sample/target/deviceDeletionSample.jar
env:
IOT_DPS_CONNECTION_STRING: ${{ secrets.IOT_DPS_CONNECTION_STRING }}
IOTHUB_CONNECTION_STRING: ${{ secrets.IOTHUB_CONNECTION_STRING }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,6 @@ package-list
**/type-search-index.zip
**/element-list
**/x.png
**/glass.png
**/glass.png

**/workspace.xml
86 changes: 86 additions & 0 deletions iot-e2e-tests/device-deletion-sample/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<!-- Copyright (c) Microsoft. All rights reserved. --><!-- Licensed under the MIT license. See LICENSE file in the project root for full license information. -->
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.azure.sdk.iot.samples.service</groupId>
<artifactId>device-deletion-sample</artifactId>
<version>1.16.0</version>
<name>device-deletion-sample</name>
<developers>
<developer>
<id>microsoft</id>
<name>Microsoft</name>
</developer>
</developers>
<parent>
<groupId>com.microsoft.azure.sdk.iot</groupId>
<artifactId>iot-e2e-tests</artifactId>
<version>1.0.0</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<finalName>deviceDeletionSample</finalName>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>with-deps</shadedClassifierName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>samples.com.microsoft.azure.sdk.iot.DeviceDeletionSample</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.microsoft.azure.sdk.iot.provisioning</groupId>
<artifactId>provisioning-service-client</artifactId>
<version>${provisioning-service-client-version}</version>
</dependency>
<dependency>
<groupId>com.microsoft.azure.sdk.iot</groupId>
<artifactId>iot-service-client</artifactId>
<version>${iot-service-client-version}</version>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit b323063

Please sign in to comment.