Skip to content

@@@ debugging

@@@ debugging #5236

# Copyright (C) 2020 Matthew Glazar
# See end of file for extended copyright information.
name: Arch Linux package
on:
push:
pull_request:
types: [opened, synchronize]
jobs:
build-arch-linux-pkg:
name: build Arch Linux .pkg
runs-on: ubuntu-latest
container: archlinux:base
steps:
- name: install dependencies
run: pacman -Syyuu --noconfirm base-devel git namcap
# HACK(strager): Work around the following error from
# 'git remote add origin ...':
#
# fatal: unsafe repository ('/__w/quick-lint-js/quick-lint-js' is owned by someone else)
#
# See also: https://github.com/actions/checkout/issues/760
- name: work around permission issue
run: git config --global --add safe.directory /__w/quick-lint-js/quick-lint-js
- name: checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
fetch-depth: 0 # Needed to determine package version.
- name: set up arch-builder user
run: |
useradd arch-builder
printf 'arch-builder ALL=(ALL) NOPASSWD: ALL\n' >/etc/sudoers.d/arch-builder
printf 'Set disable_coredump false\n' >> /etc/sudo.conf
chown -R arch-builder .
# If we are releasing a new version, we won't have a Git tag yet.
# However, the 'version' file will be updated. Create a tag based on
# 'version' if such a tag doesn't already exist. This will make the
# package's version info correctly state the new quick-lint-js version
# number.
#
# If we are not releasing a new version, a tag will already exist, so
# the 'git tag' command will fail. We ignore such failures.
- name: set up tags
run: |
git tag -- "$(head -n1 version)" || :
- name: build PKGBUILD-dev
run: |
cd dist/arch/
sudo -u arch-builder makepkg --syncdeps --cleanbuild -p PKGBUILD-dev --noconfirm
- name: lint package
run: ./dist/arch/lint.sh
- name: upload build to workflow
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
if-no-files-found: error
name: quick-lint-js-arch-${{ github.sha }}
path: dist/arch/quick-lint-js-*.pkg.tar.zst
- name: upload build to long-term storage
if: ${{ github.event_name == 'push' && github.repository_owner == 'quick-lint' != null }}
uses: quick-lint/sftp-upload@1fa54164d4bdd081207a6e54ec143d8dda3a7fb8 # v3
with:
host: ${{ secrets.artifacts_host }}
local-file-globs: dist/arch/quick-lint-js-*.pkg.tar.zst
private-key: ${{ secrets.artifacts_key }}
remote-directory: ${{ secrets.artifacts_root }}/builds/${{ github.sha }}/arch/
user: ${{ secrets.artifacts_user }}
test-arch-linux-pkg:
name: test on Arch Linux
needs: build-arch-linux-pkg
runs-on: ubuntu-latest
container: archlinux:base
steps:
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: quick-lint-js-arch-${{ github.sha }}
- name: install dependencies
run: pacman -Syyuu --noconfirm
- name: install quick-lint-js
run: pacman -U ./quick-lint-js-*.pkg.tar.zst --noconfirm
- name: test quick-lint-js
run: quick-lint-js --version
# quick-lint-js finds bugs in JavaScript programs.
# Copyright (C) 2020 Matthew Glazar
#
# This file is part of quick-lint-js.
#
# quick-lint-js is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# quick-lint-js is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with quick-lint-js. If not, see <https://www.gnu.org/licenses/>.