mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-25 14:40:26 -05:00
Delete unused workflows
This commit is contained in:
1 parent
ed3a872eb5
commit
a7ccd088f0
4 files changed
-292
No files matched your search
@@ -1,95 +0,0 @@
|
||||
name: ResInsight Build and Package
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- dev
|
||||
pull_request:
|
||||
jobs:
|
||||
ResInsight-x64:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
include:
|
||||
- os: windows-latest
|
||||
vcpkg-response-file: vcpkg_x64-windows.txt
|
||||
- os: ubuntu-latest
|
||||
vcpkg-response-file: vcpkg_x64-linux.txt
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: true
|
||||
- name: Cache Qt
|
||||
id: cache-qt
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ../Qt
|
||||
key: ${{ runner.os }}-QtCache
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v2
|
||||
with:
|
||||
version: 5.9.9
|
||||
modules: qtscript
|
||||
cached: ${{ steps.cache-qt.outputs.cache-hit }}
|
||||
- name: Install Python dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install grpcio-tools
|
||||
pip install pytest
|
||||
- name: Install Linux dependencies
|
||||
if: "contains( matrix.os, 'ubuntu')"
|
||||
run: sudo apt-get install libxkbcommon-x11-0 libgl1-mesa-dev mesa-common-dev libglfw3-dev libglu1-mesa-dev libhdf5-dev
|
||||
- name: Cache vcpkg artifacts
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ${{ github.workspace }}/vcpkg/
|
||||
# Ensure the cache is invalidated any time vcpkg version changes, or a different set of packages is being used.
|
||||
key: ${{ hashFiles( format('{0}/{1}', github.workspace, matrix.vcpkg-response-file )) }}-${{ hashFiles('.git/modules/vcpkg/HEAD') }}-${{ runner.os }}
|
||||
- name: Run vcpkg
|
||||
uses: lukka/run-vcpkg@v1
|
||||
id: runvcpkg
|
||||
with:
|
||||
vcpkgArguments: '@${{ github.workspace }}/${{ matrix.vcpkg-response-file }}'
|
||||
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
|
||||
- name: Build ResInsight-x64
|
||||
uses: lukka/run-cmake@v1
|
||||
with:
|
||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||
cmakeAppendedArgs: '-DGSL_ENABLE=true -DRESINSIGHT_ENABLE_GRPC=true -DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=python -DRESINSIGHT_ENABLE_PRECOMPILED_HEADERS=true -DRESINSIGHT_ENABLE_UNITY_BUILD=true -DRESINSIGHT_TREAT_WARNINGS_AS_ERRORS=true -DRESINSIGHT_INCLUDE_APPLICATION_UNIT_TESTS=true'
|
||||
buildDirectory: ${{ github.workspace }}/cmakebuild
|
||||
buildWithCMakeArgs: '--config Release --target package'
|
||||
useVcpkgToolchainFile: true
|
||||
continue-on-error: true
|
||||
- name: Remove packages/_CPack_Packages
|
||||
shell: bash
|
||||
run: |
|
||||
rm -rf cmakebuild/packages/_CPack_Packages
|
||||
- name: Test with pytest
|
||||
if: "contains( matrix.os, 'windows')"
|
||||
env:
|
||||
RESINSIGHT_EXECUTABLE: ${{ runner.workspace }}/ResInsight/cmakebuild/ApplicationCode/Release/ResInsight.exe
|
||||
run: |
|
||||
cd ApplicationCode/GrpcInterface/Python/rips
|
||||
pytest --console
|
||||
- name: (Windows) Run Unit Tests
|
||||
if: contains( matrix.os, 'windows')
|
||||
shell: bash
|
||||
run: |
|
||||
cmakebuild/ApplicationCode/Release/ResInsight --unittest
|
||||
- name: (Linux) Run Unit Tests
|
||||
if: "!contains( matrix.os, 'windows')"
|
||||
shell: bash
|
||||
run: |
|
||||
cmakebuild/ApplicationCode/ResInsight --unittest
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: ResInsight
|
||||
path: ${{ runner.workspace }}/ResInsight/cmakebuild/packages
|
||||
|
||||
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
name: centOS 7 (without geomech)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# Once every night
|
||||
- cron: "0 1 * * * "
|
||||
jobs:
|
||||
build_on_centos7:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: centos:7
|
||||
steps:
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
yum install -y centos-release-scl
|
||||
yum-config-manager --enable rhel-server-rhscl-7-rpms
|
||||
|
||||
yum install -y https://repo.ius.io/ius-release-el7.rpm
|
||||
yum install -y git222
|
||||
|
||||
yum install -y qt5-qtbase
|
||||
yum install -y qt5-qtbase-devel
|
||||
yum install -y qt5-qtscript-devel
|
||||
yum install -y qt5-qtsvg-devel
|
||||
|
||||
yum install -y cmake3
|
||||
yum install -y make
|
||||
|
||||
yum install -y mesa-libGL-devel
|
||||
yum install -y freeglut-devel
|
||||
|
||||
yum install -y devtoolset-10
|
||||
|
||||
yum install -y rh-python36
|
||||
- name: Build QtCharts
|
||||
run: |
|
||||
source /opt/rh/devtoolset-10/enable
|
||||
git clone git://code.qt.io/qt/qtcharts.git
|
||||
cd qtcharts/
|
||||
git checkout v5.9.7
|
||||
qmake-qt5 --version
|
||||
qmake-qt5 -makefile
|
||||
make -j 4
|
||||
make install
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: true
|
||||
- name: Set up Python
|
||||
id: python-path
|
||||
run: |
|
||||
source /opt/rh/rh-python36/enable
|
||||
python -c "import sys; print(sys.version)"
|
||||
echo "::set-output name=PYTHON_EXECUTABLE::$(python -c 'import sys; import pathlib; print (pathlib.PurePath(sys.executable).as_posix())')"
|
||||
- name: Build ResInsight
|
||||
run: |
|
||||
source /opt/rh/devtoolset-10/enable
|
||||
source /opt/rh/rh-python36/enable
|
||||
|
||||
cmake3 --version
|
||||
git --version
|
||||
g++ --version
|
||||
${{ steps.python-path.outputs.PYTHON_EXECUTABLE }} --version
|
||||
|
||||
${{ steps.python-path.outputs.PYTHON_EXECUTABLE }} -m pip install --upgrade pip
|
||||
${{ steps.python-path.outputs.PYTHON_EXECUTABLE }} -m pip install grpcio-tools
|
||||
|
||||
ThirdParty/vcpkg/bootstrap-vcpkg.sh
|
||||
ThirdParty/vcpkg/vcpkg install grpc boost-filesystem boost-spirit eigen3
|
||||
|
||||
mkdir cmakebuild
|
||||
cd cmakebuild
|
||||
cmake3 \
|
||||
-DRESINSIGHT_QT5_BUNDLE_LIBRARIES=ON \
|
||||
-DRESINSIGHT_ENABLE_GRPC=true \
|
||||
-DRESINSIGHT_ENABLE_UNITY_BUILD=true \
|
||||
-DVCPKG_TARGET_TRIPLET=x64-linux \
|
||||
-DCMAKE_TOOLCHAIN_FILE=../ThirdParty/vcpkg/scripts/buildsystems/vcpkg.cmake \
|
||||
-DRESINSIGHT_GRPC_PYTHON_EXECUTABLE=${{ steps.python-path.outputs.PYTHON_EXECUTABLE }} \
|
||||
-DRESINSIGHT_GRPC_DOWNLOAD_PYTHON_MODULE=true \
|
||||
..
|
||||
|
||||
make -j8
|
||||
make package
|
||||
rm -rf packages/_CPack_Packages
|
||||
|
||||
# Show file structure
|
||||
pwd
|
||||
ls
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ResInsight
|
||||
path: ./cmakebuild/packages
|
||||
@@ -1,76 +0,0 @@
|
||||
import json
|
||||
import urllib.request
|
||||
import requests
|
||||
import math
|
||||
import sys
|
||||
|
||||
org_name = "OPM"
|
||||
repo_name = "ResInsight"
|
||||
keep_artifacts = 100
|
||||
|
||||
def get_all_artifacts(repo_name: str, headers: dict) -> []:
|
||||
amount_items_per_page = 50
|
||||
page = 1
|
||||
|
||||
ref = "https://api.github.com/repos/" + org_name + "/" + repo_name + "/actions/artifacts" + "?per_page=" + str(amount_items_per_page)
|
||||
|
||||
result = requests.get(ref, headers=headers).json()
|
||||
#print(json.dumps(result, indent=4, sort_keys=True))
|
||||
|
||||
done = False
|
||||
|
||||
all_artifacts = []
|
||||
|
||||
while not done:
|
||||
total_count = int(result["total_count"])
|
||||
|
||||
if total_count == 0:
|
||||
done = True
|
||||
|
||||
all_artifacts = all_artifacts + result["artifacts"]
|
||||
|
||||
max_pages = math.ceil(total_count / amount_items_per_page)
|
||||
|
||||
if max_pages > page:
|
||||
page = page + 1
|
||||
else:
|
||||
done = True
|
||||
|
||||
return all_artifacts
|
||||
|
||||
|
||||
def delete_artifact(repo_name: str, artifact_id: str, headers: dict) -> bool:
|
||||
try:
|
||||
res = urllib.request.urlopen(urllib.request.Request(
|
||||
url="https://api.github.com/repos/" + org_name + "/" + repo_name + "/actions/artifacts/" + artifact_id,
|
||||
headers=headers,
|
||||
method='DELETE')
|
||||
).getcode()
|
||||
return res == 204
|
||||
except urllib.error.URLError as error:
|
||||
print(error)
|
||||
return False
|
||||
|
||||
|
||||
length = len(sys.argv)
|
||||
|
||||
if length < 2:
|
||||
print('This script requires Github access token as argment')
|
||||
sys.exit()
|
||||
|
||||
access_token = sys.argv[1]
|
||||
headers = {"content-type": "application/json; charset=UTF-8",'Authorization':'Bearer {}'.format(access_token)}
|
||||
|
||||
artifacts = get_all_artifacts(repo_name, headers)
|
||||
print("Amount of artifacts for repo " + repo_name + " is " + str(len(artifacts)))
|
||||
|
||||
if len(artifacts) > keep_artifacts:
|
||||
for a in artifacts[keep_artifacts:]:
|
||||
artifact_id = str(a["id"])
|
||||
deleted = delete_artifact(repo_name, artifact_id, headers)
|
||||
|
||||
if deleted:
|
||||
print("Repo: " + repo_name + " | Artifact with id " + artifact_id + " has been deleted")
|
||||
else:
|
||||
print("Repo: " + repo_name + " | Something went wrong while deleting artifact with id " + artifact_id)
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
name: Remove old artifacts
|
||||
|
||||
on:
|
||||
schedule:
|
||||
# Every day at 1am
|
||||
- cron: "0 1 * * *"
|
||||
|
||||
jobs:
|
||||
remove-old-artifacts:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
- name: setup python
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version: 3.8
|
||||
- name: Remove old artifacts
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install urllib3 requests
|
||||
cd .github/workflows
|
||||
python delete_artifacts.py ${{ secrets.GITHUB_TOKEN }}
|
||||
Reference in new issue
Block a user