Reputation: 149
I'm unable to successfully install and run Swift on GitHub Actions on Ubuntu.
Here's my Actions code:
name: SwiftPlot Ubuntu
on:
push:
branches: master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Freetype
run: sudo apt-get install libfreetype6-dev
- name: Install Swift Dependencies
run: sudo apt-get install clang libicu-dev
- name: Download Swift
run: wget "https://swift.org/builds/swift-5.1.3-release/ubuntu1804/swift-5.1.3-RELEASE/swift-5.1.3-RELEASE-ubuntu18.04.tar.gz"
- name: Install Swift
run: |
tar xzf swift-5.1.3-RELEASE-ubuntu18.04.tar.gz
export PATH=$(pwd)/swift-5.1.3-RELEASE-ubuntu18.04/usr/bin:"${PATH}"
- name: Build
run: swift build -v
- name: Run tests
run: swift test -v
But it's unable to find swift
. Any idea why this is happening?
Upvotes: 1
Views: 166
Reputation: 42210
Setting environment variables with export
does not work in GitHub Actions. There is a special function you can use to add a path instead.
See the documentation for add-path
here.
- name: Install Swift
run: |
tar xzf swift-5.1.3-RELEASE-ubuntu18.04.tar.gz
echo "::add-path::$(pwd)/swift-5.1.3-RELEASE-ubuntu18.04/usr/bin"
Upvotes: 1