Fixup #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
build_snap: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install snap tools | |
run: | | |
sudo apt update | |
sudo apt install -y snapd | |
snap version | |
sudo snap install --classic snapcraft | |
# workaround for GithubActionsCI+snapcraft, see https://forum.snapcraft.io/t/permissions-problem-using-snapcraft-in-azure-pipelines/13258/14 | |
sudo chown root:root / | |
snapcraft --version | |
# use multipass provider as lxd doesn't work for some reason | |
sudo snap install multipass | |
sudo snap set snapcraft provider=multipass | |
- name: Build | |
run: dotnet build --configuration Release | |
- name: Generate snap package | |
run: sudo snapcraft --destructive-mode --verbosity=verbose || sudo bash -c 'cat /root/.local/state/snapcraft/log/*.log' | |
- uses: actions/upload-artifact@v3 | |
name: Upload snap package as artifact | |
with: | |
name: snap | |
path: ./*.snap | |
integration_tests: | |
strategy: | |
matrix: | |
# macos-13 is x64 and macos-14 is arm64 | |
os: [ubuntu-22.04, macos-13, macos-14] | |
needs: build_snap | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install required dependencies | |
run: | | |
sudo apt update | |
sudo apt install --yes sudo | |
- name: Setup .NET | |
run: | | |
# We need to install `ca-certificates`, otherwise we get these errors in the CI: | |
# Unable to load the service index for source https://api.nuget.org/v3/index.json. | |
# The SSL connection could not be established, see inner exception. | |
# The remote certificate is invalid because of errors in the certificate chain: UntrustedRoot | |
sudo apt install --yes --no-install-recommends ca-certificates | |
sudo apt install --yes --no-install-recommends dotnet6 | |
- name: Run Tests | |
run: dotnet test | |
run_snap: | |
needs: build_snap | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/download-artifact@v3 | |
name: Download artifact | |
with: | |
name: snap | |
- name: Install snap | |
run: | | |
zip -r snap.zip . | |
# dangerous because it's a local snap (not one from the SnapStore) | |
sudo snap install --devmode --dangerous *.snap | |
- name: Test snap | |
run: packwallet |