Skip to content

Commit

Permalink
Merge pull request #477 from str4d/ci-test-release-artifacts
Browse files Browse the repository at this point in the history
CI: Test outputs of release workflow in test mode
  • Loading branch information
str4d authored Feb 3, 2024
2 parents 1bd3f58 + 06731f8 commit 191b9bb
Showing 1 changed file with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,83 @@ jobs:
prerelease: true
if: github.event.inputs.test != 'true'

test:
name: Test rage-${{ matrix.asset_suffix }} on ${{ matrix.os }}
needs: build
if: github.event.inputs.test == 'true'
runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
- windows-2022
- macos-11
- macos-12
- macos-13

include:
- os: ubuntu-20.04
name: linux
archive_name: rage.tar.gz
asset_suffix: x86_64-linux.tar.gz

- os: ubuntu-22.04
name: linux
archive_name: rage.tar.gz
asset_suffix: x86_64-linux.tar.gz

- os: windows-2019
name: windows
archive_name: rage.zip
asset_suffix: x86_64-windows.zip

- os: windows-2022
name: windows
archive_name: rage.zip
asset_suffix: x86_64-windows.zip

- os: macos-11
name: macos
archive_name: rage.tar.gz
asset_suffix: x86_64-darwin.tar.gz

- os: macos-12
name: macos
archive_name: rage.tar.gz
asset_suffix: x86_64-darwin.tar.gz

- os: macos-13
name: macos
archive_name: rage.tar.gz
asset_suffix: x86_64-darwin.tar.gz

steps:
- name: Download archive
uses: actions/download-artifact@v4
with:
name: rage-${{ matrix.asset_suffix }}

- name: Extract archive
run: tar xzf ${{ matrix.archive_name }}
if: matrix.name != 'windows'

- name: Extract archive [Windows]
run: 7z.exe x ${{ matrix.archive_name }}
shell: bash
if: matrix.name == 'windows'

- name: Test key generation
run: ./rage/rage-keygen -o key.txt
- name: Test encryption
run: |
echo "Hello World!" > test.txt
./rage/rage -e -i key.txt -o test.txt.age test.txt
- name: Test decryption
run: ./rage/rage -d -i key.txt test.txt.age

deb:
name: Debian ${{ matrix.name }}
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -220,3 +297,30 @@ jobs:
file_glob: true
prerelease: true
if: github.event.inputs.test != 'true'

test-deb:
name: Test rage-${{ matrix.variant }}.deb on ${{ matrix.os }}
needs: deb
if: github.event.inputs.test == 'true'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
variant: [linux, linux-musl]

steps:
- name: Download Debian package artifact
uses: actions/download-artifact@v4
with:
name: rage-${{ matrix.variant }}.deb
- name: Install Debian package
run: sudo apt install ./rage*.deb

- name: Test key generation
run: rage-keygen -o key.txt
- name: Test encryption
run: |
echo "Hello World!" > test.txt
rage -e -i key.txt -o test.txt.age test.txt
- name: Test decryption
run: rage -d -i key.txt test.txt.age

0 comments on commit 191b9bb

Please sign in to comment.