.github/workflows/test.yml #43
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
on: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
issues: read | |
pull-requests: read | |
jobs: | |
job1: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-24.04 # beta | |
- ubuntu-22.04 # ubuntu-latest | |
- ubuntu-20.04 | |
- macos-14 # macos-latest | |
- macos-13 | |
- macos-12 | |
#- windows-2022 # windows-latest | |
#- windows-2019 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: GitHubSecurityLab/actions-permissions/monitor@v1 | |
- uses: actions/checkout@v3 | |
# Docker build or pull needs CA fixup? | |
- run: | | |
cat <<EOF > Dockerfile | |
FROM node:18.16-bookworm-slim AS npm-builder | |
# Install Debian dependencies | |
RUN apt-get update -y && \ | |
apt-get install -y build-essential git && \ | |
apt-get clean && \ | |
rm -f /var/lib/apt/lists/*_* | |
COPY LICENSE / | |
CMD ["cat LICENSE"] | |
EOF | |
docker build --rm --tag elixir_boilerplate:latest . | |
- run: | | |
docker pull hello-world | |
docker run hello-world | |
- run: docker pull quay.io/jetstack/cert-manager-controller:v1.8.2 | |
# test github-script CA | |
- name: github-script | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const { data } = await github.rest.issues.listLabelsOnIssue({ | |
issue_number: 2, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}); | |
# test gh CA | |
- name: gh api | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
gh api \ | |
-H "Accept: application/vnd.github+json" \ | |
/repos/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}/issues/1/labels | |
# test curl CA | |
- name: curl | |
run: | | |
curl \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ github.token }}"\ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://Api.github.com/repos/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}/labels |