From ca2c0e6ce2255c44f4dbb364bbb964b6d95faa2a Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Tue, 14 Mar 2023 01:32:00 +0100 Subject: [PATCH] CI: update stuff (#1534) * CI: skip SNI, skip unittests if not needed, run build for setup.py * CI: update actions * CI: update upload-artifact Fixes more warnings --- .github/workflows/build.yml | 34 +++++++++++++++------------ .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/lint.yml | 4 ++-- .github/workflows/release.yml | 9 ++----- .github/workflows/unittests.yml | 18 +++++++++++--- 5 files changed, 39 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c51f15504..378dc87bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,10 +2,20 @@ name: Build -on: workflow_dispatch +on: + push: + paths: + - '.github/workflows/build.yaml' + - 'setup.py' + - 'requirements.txt' + pull_request: + paths: + - '.github/workflows/build.yaml' + - 'setup.py' + - 'requirements.txt' + workflow_dispatch: env: - SNI_VERSION: v0.0.88 ENEMIZER_VERSION: 7.1 APPIMAGETOOL_VERSION: 13 @@ -15,15 +25,13 @@ jobs: build-win-py38: # RCs will still be built and signed by hand runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.8' - name: Download run-time dependencies run: | - Invoke-WebRequest -Uri https://github.com/alttpo/sni/releases/download/${Env:SNI_VERSION}/sni-${Env:SNI_VERSION}-windows-amd64.zip -OutFile sni.zip - Expand-Archive -Path sni.zip -DestinationPath SNI -Force Invoke-WebRequest -Uri https://github.com/Ijwu/Enemizer/releases/download/${Env:ENEMIZER_VERSION}/win-x64.zip -OutFile enemizer.zip Expand-Archive -Path enemizer.zip -DestinationPath EnemizerCLI -Force - name: Build @@ -39,7 +47,7 @@ jobs: Rename-Item exe.$NAME Archipelago 7z a -mx=9 -mhe=on -ms "../dist/$ZIP_NAME" Archipelago - name: Store 7z - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: ${{ env.ZIP_NAME }} path: dist/${{ env.ZIP_NAME }} @@ -49,14 +57,14 @@ jobs: runs-on: ubuntu-18.04 steps: # - copy code below to release.yml - - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install base dependencies run: | sudo apt update sudo apt -y install build-essential p7zip xz-utils wget libglib2.0-0 sudo apt -y install python3-gi libgirepository1.0-dev # should pull dependencies for gi installation below - name: Get a recent python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.9' - name: Install build-time dependencies @@ -69,10 +77,6 @@ jobs: chmod a+rx appimagetool - name: Download run-time dependencies run: | - wget -nv https://github.com/alttpo/sni/releases/download/$SNI_VERSION/sni-$SNI_VERSION-manylinux2014-amd64.tar.xz - tar xf sni-*.tar.xz - rm sni-*.tar.xz - mv sni-* SNI wget -nv https://github.com/Ijwu/Enemizer/releases/download/$ENEMIZER_VERSION/ubuntu.16.04-x64.7z 7za x -oEnemizerCLI/ ubuntu.16.04-x64.7z - name: Build @@ -93,13 +97,13 @@ jobs: echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV # - copy code above to release.yml - - name: Store AppImage - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: ${{ env.APPIMAGE_NAME }} path: dist/${{ env.APPIMAGE_NAME }} retention-days: 7 - name: Store .tar.gz - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: ${{ env.TAR_NAME }} path: dist/${{ env.TAR_NAME }} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index b331c2550..d42ad493e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -35,7 +35,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 28adb5002..b2aa9a846 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,9 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python 3.9 - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: 3.9 - name: Install dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e9559f785..fa3dd3210 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,6 @@ on: - '*.*.*' env: - SNI_VERSION: v0.0.88 ENEMIZER_VERSION: 7.1 APPIMAGETOOL_VERSION: 13 @@ -36,14 +35,14 @@ jobs: - name: Set env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV # - code below copied from build.yml - - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install base dependencies run: | sudo apt update sudo apt -y install build-essential p7zip xz-utils wget libglib2.0-0 sudo apt -y install python3-gi libgirepository1.0-dev # should pull dependencies for gi installation below - name: Get a recent python - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: '3.9' - name: Install build-time dependencies @@ -56,10 +55,6 @@ jobs: chmod a+rx appimagetool - name: Download run-time dependencies run: | - wget -nv https://github.com/alttpo/sni/releases/download/$SNI_VERSION/sni-$SNI_VERSION-manylinux2014-amd64.tar.xz - tar xf sni-*.tar.xz - rm sni-*.tar.xz - mv sni-* SNI wget -nv https://github.com/Ijwu/Enemizer/releases/download/$ENEMIZER_VERSION/ubuntu.16.04-x64.7z 7za x -oEnemizerCLI/ ubuntu.16.04-x64.7z - name: Build diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index fe61c8b0f..c3969ee2b 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -3,7 +3,19 @@ name: unittests -on: [push, pull_request] +on: + push: + paths-ignore: + - 'docs/**' + - 'setup.py' + - '*.iss' + - '.gitignore' + pull_request: + paths-ignore: + - 'docs/**' + - 'setup.py' + - '*.iss' + - '.gitignore' jobs: build: @@ -27,9 +39,9 @@ jobs: os: macos-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python.version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python.version }} - name: Install dependencies