Skip to content

Fix indentation

Fix indentation #2694

Workflow file for this run

on:
push:
branches:
- main
pull_request:
branches:
- main
name: CI
jobs:
flatpak:
name: Flatpak
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-44
options: --privileged
strategy:
matrix:
arch: [x86_64, aarch64]
# Don't fail the whole workflow if one architecture fails
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
dnf -y install docker
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: graphs.flatpak
run-tests: true
manifest-path: se.sjoerd.Graphs.json
cache-key: flatpak-builder-${{ github.sha }}
arch: ${{ matrix.arch }}
snap:
name: Snap
runs-on: ubuntu-latest
strategy:
matrix:
architecture:
- amd64
- arm64
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup snapcraft
env:
LP_BUILD_SECRET: ${{ secrets.LP_BUILD_SECRET }}
run: |
sudo snap install snapcraft --classic
# Setup Launchpad credentials
mkdir -p ~/.local/share/snapcraft/provider/launchpad
echo "$LP_BUILD_SECRET" > ~/.local/share/snapcraft/provider/launchpad/credentials
git config --global user.email "github-actions@github.com"
git config --global user.name "Github Actions"
sudo apt-get update; sudo apt-get install -y moreutils
- name: Build
id: build
env:
ARCHITECTURE: ${{ matrix.architecture }}
run: |
# Remove the architecture definition from the snapcraft.yaml due to:
# https://bugs.launchpad.net/snapcraft/+bug/1885150
cat snap/snapcraft.yaml | yq 'del(.architectures)' | sponge snap/snapcraft.yaml
snapcraft remote-build --launchpad-accept-public-upload --build-for=${ARCHITECTURE}
release_line=$(grep -m 1 '<release version=' "data/se.sjoerd.Graphs.appdata.xml.in.in")
version=$(echo "$release_line" | sed -n 's/.*version="\([^"]*\)".*/\1/p')
if [ ! -f "graphs_${version}_${ARCHITECTURE}.snap" ]; then
echo "Snap file not found, check the build log below to find error"
cat graphs_${ARCHITECTURE}.txt
exit 1
fi
cat "graphs_${ARCHITECTURE}.txt"
echo "snap=graphs_${version}_${ARCHITECTURE}.snap" >> "$GITHUB_OUTPUT"
- name: Publish to edge channel
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }}
with:
snap: ${{ steps.build.outputs.snap }}
release: edge
flake8-lint:
name: flake8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.10"
# Install flake8 extensions (this step is not required. Default is "None").
- name: Set up flake8
run: pip install flake8-docstrings flake8-simplify flake8-unused-arguments flake8-quotes flake8-bugbear flake8-pie flake8-print flake8-warnings flake8-commas flake8-builtins flake8-import-order pep8-naming
- name: flake8 Lint
uses: reviewdog/action-flake8@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
fail_on_error: true